1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-01-24 05:20:04 +08:00

Fix lsp layer

This commit is contained in:
wsdjeg 2017-12-22 21:42:18 +08:00
parent 167d1b0c55
commit c8c9d6688a
2 changed files with 8 additions and 5 deletions

View File

@ -26,8 +26,6 @@ endfunction
let s:auto_fix = 0
function! SpaceVim#layers#lang#javascript#set_variable(var) abort
let s:use_lsp = get(a:var, 'use_lsp', 0) && has('nvim')
\ && executable('javascript-typescript-stdio')
let s:auto_fix = get(a:var, 'auto_fix', 0)
endfunction

View File

@ -70,10 +70,15 @@ let s:lsp_servers = {
function! SpaceVim#layers#lsp#set_variable(var) abort
for ft in get(a:var, 'filetypes', [])
if executable(s:lsp_servers[ft][0])
call add(s:enabled_fts, ft)
let cmd = get(s:lsp_servers, ft, [''])[0]
if empty(cmd)
call SpaceVim#logger#warn('Failed to find the lsp server command for ' . ft)
else
call SpaceVim#logger#warn('Failed to enable lsp for ' . ft . ', ' . s:lsp_servers[ft][0] . 'is not executable!')
if executable(cmd)
call add(s:enabled_fts, ft)
else
call SpaceVim#logger#warn('Failed to enable lsp for ' . ft . ', ' . cmd . 'is not executable!')
endif
endif
endfor
endfunction