2

I am using Tsuquyomi as a Syntastic plugin for checking TypeScript in Vim. I expect to see all errors when I open the file. Instead, I only see ESLint errors. I can only see Tsuquyomi errors when saving or manually running the checker.

In my .vimrc, I configure Syntastic to check with Tsuquyomi on open:

" Configure syntax management
let g:syntastic_error_symbol = "✗"
let g:syntastic_warning_symbol = "⚠"
let g:syntastic_javascript_checkers = ['eslint', 'standard']
let g:syntastic_cs_checkers = ['syntax', 'semantic', 'issues']
let g:syntastic_ignore_files = ['Sync/ebs/*']
let syntastic_mode_map = { 'passive_filetypes': ['less'] }
set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*
let g:syntastic_always_populate_loc_list = 1
let g:syntastic_auto_loc_list = 1
let g:syntastic_check_on_open = 1
let g:syntastic_typescript_checkers = ['tsuquyomi']
let g:tsuquyomi_disable_quickfix = 0
let g:syntastic_debug = 3
" Frustratingly necessary for syntastic redrawing
set autoread
set ttyfast
au FileWritePost * :redraw!
au TermResponse * :redraw!
au TextChanged * :redraw!
au QuickFixCmdPre * :redraw!
au QuickFixCmdPost * :redraw!

If I create a file with errors, for example x.ts:

const a: number = 'a'

console.log('a test:', a)

When I open the file, no errors are shown. The output from :mes shows that Tsuquyomi hasn't found any errors:

"src/x.ts" 3L, 49C
syntastic: 0.544308: g:syntastic_version = '3.8.0-94 (Vim 801, Linux, GUI)'
syntastic: 0.544445: &shell = '/usr/bin/zsh', &shellcmdflag = '-c', &shellpipe = '2>&1| tee', &shellquote = '', &shellredir = '>%s 2>&1', &shelltemp = 1, &shellxquote = '', &autochdir = 0, &shellxescape = ''
syntastic: 0.544821: UpdateErrors (auto): default checkers
syntastic: 0.545096: CacheErrors: default checkers
syntastic: 0.545567: g:syntastic_aggregate_errors = 0
syntastic: 0.545754: getcwd() = '/home/david/Sync/phaser3-typescript-project-template'
syntastic: 0.550256: CacheErrors: Invoking checker: typescript/tsuquyomi
syntastic: 2.404657: getLocList: checker typescript/tsuquyomi returned 0
syntastic: 2.404823: typescript/tsuquyomi raw: []
syntastic: 2.405012: quiet_messages filter: {}
syntastic: 2.405159: getLocList: checker typescript/tsuquyomi run in 1.854759s
syntastic: 2.405434: aggregated: {'_sorted': 0, '_name': '', '_owner': 1, '_columns': 1, '_rawLoclist': []}

If I then manually check with :SyntasticCheck, the error does show, and it is listed in :mes:

Messages maintainer: Bram Moolenaar <Bram@vim.org>
"src/x.ts" 3L, 49C
syntastic: 0.432894: g:syntastic_version = '3.8.0-94 (Vim 801, Linux, GUI)'
syntastic: 0.432996: &shell = '/usr/bin/zsh', &shellcmdflag = '-c', &shellpipe = '2>&1| tee', &shellquote = '', &shellredir = '>%s 2>&1', &shelltemp = 1, &shellxquote = '', &autochdir = 0, &shellxescape = ''
syntastic: 0.433309: UpdateErrors (auto): default checkers
syntastic: 0.433540: CacheErrors: default checkers
syntastic: 0.434051: g:syntastic_aggregate_errors = 0
syntastic: 0.434179: getcwd() = '/home/david/Sync/phaser3-typescript-project-template'
syntastic: 0.646807: system: command run in 0.208338s
syntastic: 0.647076: CacheErrors: Invoking checker: typescript/eslint
syntastic: 0.647493: SyntasticMake: called with options: {'postprocess': ['guards'], 'errorformat': '%E%f: line %l\, col %c\, Error - %m,%W%f: line %l\, col %c\, Warning - %m', 'makeprg': 'eslint -f compact src/
x.ts'}
syntastic: 3.528810: system: command run in 2.880954s
syntastic: 3.529040: checker output: ['']
syntastic: 3.529402: raw loclist: [{'lnum': 0, 'bufnr': 0, 'col': 0, 'valid': 0, 'vcol': 0, 'nr': -1, 'module': '', 'type': '', 'pattern': '', 'text': ''}]
syntastic: 3.530081: postprocess: [{'lnum': 0, 'bufnr': 0, 'col': 0, 'valid': 0, 'vcol': 0, 'nr': -1, 'module': '', 'type': '', 'pattern': '', 'text': ''}]
syntastic: 3.530351: getLocList: checker typescript/eslint returned 0
syntastic: 3.530516: typescript/eslint raw: [{'lnum': 0, 'bufnr': 0, 'col': 0, 'valid': 0, 'vcol': 0, 'nr': -1, 'module': '', 'type': '', 'pattern': '', 'text': ''}]
syntastic: 3.530739: quiet_messages filter: {}
syntastic: 3.530953: getLocList: checker typescript/eslint run in 2.883754s
syntastic: 3.531414: CacheErrors: Invoking checker: typescript/tsuquyomi
syntastic: 3.600012: getLocList: checker typescript/tsuquyomi returned 0
syntastic: 3.600261: typescript/tsuquyomi raw: []
syntastic: 3.600468: quiet_messages filter: {}
syntastic: 3.600669: getLocList: checker typescript/tsuquyomi run in 0.069068s
syntastic: 3.600990: aggregated: {'_sorted': 0, '_name': '', '_owner': 1, '_columns': 1, '_rawLoclist': []}
syntastic: 65.325780: g:syntastic_version = '3.8.0-94 (Vim 801, Linux, GUI)'
syntastic: 65.326247: &shell = '/usr/bin/zsh', &shellcmdflag = '-c', &shellpipe = '2>&1| tee', &shellquote = '', &shellredir = '>%s 2>&1', &shelltemp = 1, &shellxquote = '', &autochdir = 0, &shellxescape = ''
syntastic: 65.327336: UpdateErrors: default checkers
syntastic: 65.328042: CacheErrors: default checkers
syntastic: 65.329746: g:syntastic_aggregate_errors = 0
syntastic: 65.330482: getcwd() = '/home/david/Sync/phaser3-typescript-project-template'
syntastic: 65.332150: CacheErrors: Invoking checker: typescript/eslint
syntastic: 65.334221: SyntasticMake: called with options: {'postprocess': ['guards'], 'errorformat': '%E%f: line %l\, col %c\, Error - %m,%W%f: line %l\, col %c\, Warning - %m', 'makeprg': 'eslint -f compact src
/x.ts'}
syntastic: 67.663350: system: command run in 2.328375s
syntastic: 67.663507: checker output: ['']
syntastic: 67.663724: raw loclist: [{'lnum': 0, 'bufnr': 0, 'col': 0, 'valid': 0, 'vcol': 0, 'nr': -1, 'module': '', 'type': '', 'pattern': '', 'text': ''}]
syntastic: 67.663915: postprocess: [{'lnum': 0, 'bufnr': 0, 'col': 0, 'valid': 0, 'vcol': 0, 'nr': -1, 'module': '', 'type': '', 'pattern': '', 'text': ''}]
syntastic: 67.664079: getLocList: checker typescript/eslint returned 0
syntastic: 67.664235: typescript/eslint raw: [{'lnum': 0, 'bufnr': 0, 'col': 0, 'valid': 0, 'vcol': 0, 'nr': -1, 'module': '', 'type': '', 'pattern': '', 'text': ''}]
syntastic: 67.664398: quiet_messages filter: {}
syntastic: 67.664516: getLocList: checker typescript/eslint run in 2.331968s
syntastic: 67.664731: CacheErrors: Invoking checker: typescript/tsuquyomi
syntastic: 67.720773: getLocList: checker typescript/tsuquyomi returned 0
syntastic: 67.720950: typescript/tsuquyomi raw: [{'lnum': 1, 'valid': 1, 'col': 7, 'availableCodeFix': 1, 'filename': '/home/david/Sync/phaser3-typescript-project-template/src/x.ts', 'bufnr': 1, 'code': 2322, 't
ype': 'E', 'text': '2322[QF available]: Type ''"a"'' is not assignable to type ''number''.'}]

How can I make Tsuquyomi show TypeScript errors when opening while ensuring I always see them as fast as possible?

David Y. Stephenson
  • 872
  • 4
  • 22
  • 44

1 Answers1

1

You have this line:

let g:tsuquyomi_disable_quickfix = 1

This option suppresses to check the syntax/semantic.

It seems that saving and manually triggering are working despite of this setting and only the immediate check is blocked, as you observed.

Sources:

https://github.com/Quramy/tsuquyomi/issues/183

Edit:

If that does not work, let's obey the documentations:

Integrate with syntastic

If you use syntastic, you can use syntastic for displaying syntax and semantics errors instead of vim's default quickfix window. To integrate syntastic, write the following setting to your .vimrc.

let g:tsuquyomi_disable_quickfix = 1
let g:syntastic_typescript_checkers = ['tsuquyomi'] " You shouldn't use 'tsc' checker.

syntastic has default TypeScript checker whose name is 'tsc'. You shouldn't use it with running Tusuquyomi because they don't share compile options. Tusuquyomi's checker whose name is 'tsuquyomi' uses tsserver and your tsconfig.json.

You seem to have on that second line:

let g:syntastic_typescript_checkers = ['eslint', 'tsuquyomi']

I would test dropping the 'eslint' away, see if it helps, and if you really like both at same time, we should look for other way to configure them.

Sources:

https://github.com/Quramy/tsuquyomi

Edit2:

[..], each checker will be called, in order, as long as the previous checkers don’t return an error. In that case, you might want to list checkers from fastest to slowest, or from looser to stricter.

So, does your eslint error(s) actually prevent tsuquyomi showing its own one(s)? Would be worth checking to change their order.

Sources:

https://blog.jpalardy.com/posts/how-to-configure-syntastic/

mico
  • 12,730
  • 12
  • 59
  • 99