mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-01-23 10:30:05 +08:00
Merge pull request #1265 from sei40kr/feature/fix-lsp-config
Fix language client config
This commit is contained in:
commit
bacbf28bf6
@ -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
|
||||
|
56
config/plugins_before/LanguageClient-neovim.vim
Normal file
56
config/plugins_before/LanguageClient-neovim.vim
Normal 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
|
Loading…
Reference in New Issue
Block a user