mirror of https://github.com/dense-analysis/ale
Fix #1781 - Fix me breaking the tsserver linter
This commit is contained in:
parent
fefb8efff8
commit
209cd54783
|
@ -5,22 +5,13 @@ call ale#Set('javascript_tsserver_executable', 'tsserver')
|
|||
call ale#Set('javascript_tsserver_config_path', '')
|
||||
call ale#Set('javascript_tsserver_use_global', get(g:, 'ale_use_global_executables', 0))
|
||||
|
||||
" These functions need to be defined just to comply with the API for LSP.
|
||||
function! ale_linters#javascript#tsserver#GetProjectRoot(buffer) abort
|
||||
return ''
|
||||
endfunction
|
||||
|
||||
function! ale_linters#javascript#tsserver#GetExecutable(buffer) abort
|
||||
return ale#node#FindExecutable(a:buffer, 'javascript_tsserver', [
|
||||
\ 'node_modules/.bin/tsserver',
|
||||
\])
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('javascript', {
|
||||
\ 'name': 'tsserver',
|
||||
\ 'lsp': 'tsserver',
|
||||
\ 'executable_callback': 'ale_linters#javascript#tsserver#GetExecutable',
|
||||
\ 'command_callback': 'ale_linters#javascript#tsserver#GetExecutable',
|
||||
\ 'project_root_callback': 'ale_linters#javascript#tsserver#GetProjectRoot',
|
||||
\ 'executable_callback': ale#node#FindExecutableFunc('javascript_tsserver', [
|
||||
\ 'node_modules/.bin/tsserver',
|
||||
\ ]),
|
||||
\ 'command': '%e',
|
||||
\ 'project_root_callback': {-> ''},
|
||||
\ 'language': '',
|
||||
\})
|
||||
|
|
|
@ -11,7 +11,7 @@ call ale#linter#Define('typescript', {
|
|||
\ 'executable_callback': ale#node#FindExecutableFunc('typescript_tsserver', [
|
||||
\ 'node_modules/.bin/tsserver',
|
||||
\ ]),
|
||||
\ 'command_callback': 'ale_linters#typescript#tsserver#GetExecutable',
|
||||
\ 'command': '%e',
|
||||
\ 'project_root_callback': {-> ''},
|
||||
\ 'language': '',
|
||||
\})
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
Before:
|
||||
call ale#assert#SetUpLinterTest('javascript', 'tsserver')
|
||||
|
||||
After:
|
||||
call ale#assert#TearDownLinterTest()
|
||||
|
||||
Execute(The default command should be correct):
|
||||
AssertLinter 'tsserver', ale#Escape('tsserver')
|
|
@ -0,0 +1,8 @@
|
|||
Before:
|
||||
call ale#assert#SetUpLinterTest('typescript', 'tsserver')
|
||||
|
||||
After:
|
||||
call ale#assert#TearDownLinterTest()
|
||||
|
||||
Execute(The default command should be correct):
|
||||
AssertLinter 'tsserver', ale#Escape('tsserver')
|
Loading…
Reference in New Issue