From 5b6df0a85fbed8081fa217473a8c52f3b406faff Mon Sep 17 00:00:00 2001 From: w0rp Date: Fri, 15 Feb 2019 15:34:31 +0000 Subject: Fix #2299 - Make tsserver run again --- autoload/ale/lsp.vim | 2 +- autoload/ale/lsp_linter.vim | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/autoload/ale/lsp.vim b/autoload/ale/lsp.vim index 7718b349..8da95ef6 100644 --- a/autoload/ale/lsp.vim +++ b/autoload/ale/lsp.vim @@ -347,7 +347,7 @@ function! ale#lsp#StartProgram(conn_id, executable, command) abort let l:conn.job_id = l:job_id endif - if l:started + if l:started && !l:conn.is_tsserver call s:SendInitMessage(l:conn) endif diff --git a/autoload/ale/lsp_linter.vim b/autoload/ale/lsp_linter.vim index e04915b0..610d897f 100644 --- a/autoload/ale/lsp_linter.vim +++ b/autoload/ale/lsp_linter.vim @@ -238,6 +238,11 @@ function! ale#lsp_linter#StartLSP(buffer, linter, Callback) abort let l:conn_id = ale#lsp#Register(l:executable, l:root, l:init_options) + " tsserver behaves differently, so tell the LSP API that it is tsserver. + if a:linter.lsp is# 'tsserver' + call ale#lsp#MarkConnectionAsTsserver(l:conn_id) + endif + let l:command = ale#linter#GetCommand(a:buffer, a:linter) " Format the command, so %e can be formatted into it. let l:command = ale#command#FormatCommand(a:buffer, l:executable, l:command, 0, v:false)[1] @@ -253,10 +258,6 @@ function! ale#lsp_linter#StartLSP(buffer, linter, Callback) abort return 0 endif - " tsserver behaves differently, so tell the LSP API that it is tsserver. - if a:linter.lsp is# 'tsserver' - call ale#lsp#MarkConnectionAsTsserver(l:conn_id) - endif let l:details = { \ 'buffer': a:buffer, -- cgit v1.2.3