2015-07-18 17:05:45 -04:00
|
|
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'typescript') == -1
|
|
|
|
|
2013-09-26 06:41:08 -04:00
|
|
|
if exists("current_compiler")
|
|
|
|
finish
|
|
|
|
endif
|
|
|
|
let current_compiler = "typescript"
|
|
|
|
|
2015-01-23 15:09:23 -05:00
|
|
|
if !exists("g:typescript_compiler_binary")
|
|
|
|
let g:typescript_compiler_binary = "tsc"
|
|
|
|
endif
|
|
|
|
|
2014-12-09 17:09:20 -05:00
|
|
|
if !exists("g:typescript_compiler_options")
|
|
|
|
let g:typescript_compiler_options = ""
|
|
|
|
endif
|
|
|
|
|
2016-09-11 07:24:17 -04:00
|
|
|
if exists(":CompilerSet") != 2
|
|
|
|
command! -nargs=* CompilerSet setlocal <args>
|
|
|
|
endif
|
|
|
|
|
2017-09-27 13:57:29 -04:00
|
|
|
let s:cpo_save = &cpo
|
|
|
|
set cpo-=C
|
|
|
|
|
|
|
|
execute 'CompilerSet makeprg='
|
|
|
|
\ . escape(g:typescript_compiler_binary, ' ')
|
|
|
|
\ . '\ '
|
|
|
|
\ . escape(g:typescript_compiler_options, ' ')
|
|
|
|
\ . '\ $*\ %'
|
2013-09-26 06:41:08 -04:00
|
|
|
|
|
|
|
CompilerSet errorformat=%+A\ %#%f\ %#(%l\\\,%c):\ %m,%C%m
|
2015-07-18 17:05:45 -04:00
|
|
|
|
2017-09-27 13:57:29 -04:00
|
|
|
let &cpo = s:cpo_save
|
|
|
|
unlet s:cpo_save
|
|
|
|
|
2015-07-18 17:05:45 -04:00
|
|
|
endif
|