Skip to content
This repository was archived by the owner on Sep 20, 2023. It is now read-only.

Commit fe43637

Browse files
committed
Checker tsc: version 1.5 has option "--noEmit".
1 parent a17db15 commit fe43637

File tree

3 files changed

+22
-5
lines changed

3 files changed

+22
-5
lines changed

autoload/syntastic/util.vim

+2-2
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,8 @@ function! syntastic#util#var(name, ...) abort " {{{2
140140
endfunction " }}}2
141141

142142
" Parse a version string. Return an array of version components.
143-
function! syntastic#util#parseVersion(version) abort " {{{2
144-
return map(split(matchstr( a:version, '\v^\D*\zs\d+(\.\d+)+\ze' ), '\m\.'), 'str2nr(v:val)')
143+
function! syntastic#util#parseVersion(version, ...) abort " {{{2
144+
return map(split(matchstr( a:version, a:0 ? a:1 : '\v^\D*\zs\d+(\.\d+)+\ze' ), '\m\.'), 'str2nr(v:val)')
145145
endfunction " }}}2
146146

147147
" Verify that the 'installed' version is at least the 'required' version.

plugin/syntastic.vim

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ if has('reltime')
1919
lockvar! g:_SYNTASTIC_START
2020
endif
2121

22-
let g:_SYNTASTIC_VERSION = '3.6.0-67'
22+
let g:_SYNTASTIC_VERSION = '3.6.0-70'
2323
lockvar g:_SYNTASTIC_VERSION
2424

2525
" Sanity checks {{{1

syntax_checkers/typescript/tsc.vim

+19-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"============================================================================
2-
"File: typescript.vim
2+
"File: tsc.vim
33
"Description: TypeScript syntax checker
44
"Maintainer: Bill Casarin <[email protected]>
55
"============================================================================
@@ -17,9 +17,26 @@ let s:save_cpo = &cpo
1717
set cpo&vim
1818

1919
function! SyntaxCheckers_typescript_tsc_GetLocList() dict
20+
if !exists('s:tsc_new')
21+
let s:tsc_new = -1
22+
try
23+
let tsc_version = filter(split(syntastic#util#system(self.getExecEscaped() . ' --version'), '\n'), 'v:val =~# ''\m\<Version ''')[0]
24+
let ver = syntastic#util#parseVersion(tsc_version, '\v<Version \zs\d+(\.\d+)\ze')
25+
call self.setVersion(ver)
26+
27+
let s:tsc_new = syntastic#util#versionIsAtLeast(ver, [1, 5])
28+
catch /\m^Vim\%((\a\+)\)\=:E684/
29+
call syntastic#log#error("checker typescript/tsc: can't parse version string (abnormal termination?)")
30+
endtry
31+
endif
32+
33+
if s:tsc_new < 0
34+
return []
35+
endif
36+
2037
let makeprg = self.makeprgBuild({
2138
\ 'args': '--module commonjs',
22-
\ 'args_after': '--out ' . syntastic#util#DevNull() })
39+
\ 'args_after': (s:tsc_new ? '--noEmit' : '--out ' . syntastic#util#DevNull()) })
2340

2441
let errorformat =
2542
\ '%E%f %#(%l\,%c): error %m,' .

0 commit comments

Comments
 (0)