1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-01-23 13:10:04 +08:00

Merge pull request #1265 from sei40kr/feature/fix-lsp-config

Fix language client config
This commit is contained in:
Wang Shidong 2018-01-12 20:51:53 +08:00 committed by GitHub
commit bacbf28bf6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 59 additions and 50 deletions

View File

@ -3,7 +3,7 @@ function! SpaceVim#layers#lsp#plugins() abort
if has('nvim')
call add(plugins, ['SpaceVim/LanguageClient-neovim',
\ { 'merged': 0, 'if': has('python3') }])
\ { 'merged': 0, 'if': has('python3'), 'loadconf_before': 1 }])
else
call add(plugins, ['prabirshrestha/async.vim', {'merged' : 0}])
call add(plugins, ['prabirshrestha/vim-lsp', {'merged' : 0}])
@ -13,57 +13,10 @@ function! SpaceVim#layers#lsp#plugins() abort
endfunction
function! SpaceVim#layers#lsp#config() abort
" SpaceVim/LanguageClient-neovim {{{
let g:LanguageClient_diagnosticsDisplay = {
\ 1: {
\ 'name': 'Error',
\ 'signText': g:spacevim_error_symbol,
\ },
\ 2: {
\ 'name': 'Warning',
\ 'signText': g:spacevim_warning_symbol,
\ },
\ 3: {
\ 'name': 'Information',
\ 'signText': g:spacevim_info_symbol,
\ },
\ 4: {
\ 'name': 'Hint',
\ 'signText': g:spacevim_info_symbol,
\ },
\ }
if g:spacevim_enable_neomake
let g:LanguageClient_diagnosticsDisplay[1].texthl = 'NeomakeError'
let g:LanguageClient_diagnosticsDisplay[1].signTexthl = 'NeomakeErrorSign'
let g:LanguageClient_diagnosticsDisplay[2].texthl = 'NeomakeWarning'
let g:LanguageClient_diagnosticsDisplay[2].signTexthl =
\ 'NeomakeWarningSign'
let g:LanguageClient_diagnosticsDisplay[3].texthl = 'NeomakeInfo'
let g:LanguageClient_diagnosticsDisplay[3].signTexthl = 'NeomakeInfoSign'
let g:LanguageClient_diagnosticsDisplay[4].texthl = 'NeomakeMessage'
let g:LanguageClient_diagnosticsDisplay[4].signTexthl =
\ 'NeomakeMessageSign'
elseif g:spacevim_enable_ale
let g:LanguageClient_diagnosticsDisplay[1].texthl = 'ALEError'
let g:LanguageClient_diagnosticsDisplay[1].signTexthl = 'ALEErrorSign'
let g:LanguageClient_diagnosticsDisplay[2].texthl = 'ALEWarning'
let g:LanguageClient_diagnosticsDisplay[2].signTexthl = 'ALEWarningSign'
let g:LanguageClient_diagnosticsDisplay[3].texthl = 'ALEInfo'
let g:LanguageClient_diagnosticsDisplay[3].signTexthl = 'ALEInfoSign'
let g:LanguageClient_diagnosticsDisplay[4].texthl = 'ALEInfo'
let g:LanguageClient_diagnosticsDisplay[4].signTexthl = 'ALEInfoSign'
endif
let g:LanguageClient_autoStart = 1
" prabirshrestha/vim-lsp {{{
let g:lsp_async_completion = 1
" }}}
for ft in s:enabled_fts
call SpaceVim#lsp#reg_server(ft, s:lsp_servers[ft])
endfor

View File

@ -0,0 +1,56 @@
"=============================================================================
" LanguageClient-neovim.vim
" Copyright (c) 2012-2016 Shidong Wang & Contributors
" Author: Seong Yong-ju <sei40kr@gmail.com>
" URL: https://spacevim.org
" License: MIT license
"=============================================================================
let g:LanguageClient_autoStart = 1
let g:LanguageClient_diagnosticsDisplay = {
\ 1: {
\ 'name': 'Error',
\ 'signText': g:spacevim_error_symbol,
\ },
\ 2: {
\ 'name': 'Warning',
\ 'signText': g:spacevim_warning_symbol,
\ },
\ 3: {
\ 'name': 'Information',
\ 'signText': g:spacevim_info_symbol,
\ },
\ 4: {
\ 'name': 'Hint',
\ 'signText': g:spacevim_info_symbol,
\ },
\ }
if g:spacevim_enable_neomake
let g:LanguageClient_diagnosticsDisplay[1].texthl = 'NeomakeError'
let g:LanguageClient_diagnosticsDisplay[1].signTexthl = 'NeomakeErrorSign'
let g:LanguageClient_diagnosticsDisplay[2].texthl = 'NeomakeWarning'
let g:LanguageClient_diagnosticsDisplay[2].signTexthl =
\ 'NeomakeWarningSign'
let g:LanguageClient_diagnosticsDisplay[3].texthl = 'NeomakeInfo'
let g:LanguageClient_diagnosticsDisplay[3].signTexthl = 'NeomakeInfoSign'
let g:LanguageClient_diagnosticsDisplay[4].texthl = 'NeomakeMessage'
let g:LanguageClient_diagnosticsDisplay[4].signTexthl =
\ 'NeomakeMessageSign'
elseif g:spacevim_enable_ale
let g:LanguageClient_diagnosticsDisplay[1].texthl = 'ALEError'
let g:LanguageClient_diagnosticsDisplay[1].signTexthl = 'ALEErrorSign'
let g:LanguageClient_diagnosticsDisplay[2].texthl = 'ALEWarning'
let g:LanguageClient_diagnosticsDisplay[2].signTexthl = 'ALEWarningSign'
let g:LanguageClient_diagnosticsDisplay[3].texthl = 'ALEInfo'
let g:LanguageClient_diagnosticsDisplay[3].signTexthl = 'ALEInfoSign'
let g:LanguageClient_diagnosticsDisplay[4].texthl = 'ALEInfo'
let g:LanguageClient_diagnosticsDisplay[4].signTexthl = 'ALEInfoSign'
endif