summaryrefslogtreecommitdiff
path: root/ale_linters/typescript
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2017-07-26 10:37:37 +0100
committerw0rp <devw0rp@gmail.com>2017-07-26 10:37:37 +0100
commitcd860e3e8d2b8d35920f27279bbd1ec346ac4d62 (patch)
tree03c63eb3e37d2e2b5761f3bbe3af7b1b0e8e05df /ale_linters/typescript
parent86297a7c65eadc5dc7668e129c92316aa0a89898 (diff)
downloadale-cd860e3e8d2b8d35920f27279bbd1ec346ac4d62.zip
#517 Add more code LSP support which makes the tssserver linter behave more like the LSP linters
Diffstat (limited to 'ale_linters/typescript')
-rw-r--r--ale_linters/typescript/tsserver.vim11
1 files changed, 11 insertions, 0 deletions
diff --git a/ale_linters/typescript/tsserver.vim b/ale_linters/typescript/tsserver.vim
index 465e80c7..7a155bd9 100644
--- a/ale_linters/typescript/tsserver.vim
+++ b/ale_linters/typescript/tsserver.vim
@@ -5,6 +5,15 @@ call ale#Set('typescript_tsserver_executable', 'tsserver')
call ale#Set('typescript_tsserver_config_path', '')
call ale#Set('typescript_tsserver_use_global', 0)
+" These functions need to be defined just to comply with the API for LSP.
+function! ale_linters#typescript#tsserver#GetProjectRoot(buffer) abort
+ return ''
+endfunction
+
+function! ale_linters#typescript#tsserver#GetLanguage(buffer) abort
+ return ''
+endfunction
+
function! ale_linters#typescript#tsserver#GetExecutable(buffer) abort
return ale#node#FindExecutable(a:buffer, 'typescript_tsserver', [
\ 'node_modules/.bin/tsserver',
@@ -16,4 +25,6 @@ call ale#linter#Define('typescript', {
\ 'lsp': 'tsserver',
\ 'executable_callback': 'ale_linters#typescript#tsserver#GetExecutable',
\ 'command_callback': 'ale_linters#typescript#tsserver#GetExecutable',
+\ 'project_root_callback': 'ale_linters#typescript#tsserver#GetProjectRoot',
+\ 'language_callback': 'ale_linters#typescript#tsserver#GetLanguage',
\})