mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-01-23 12:50:04 +08:00
Fix lsp support for lang#c layer (#3652)
This commit is contained in:
parent
bfd221d9c8
commit
bea44f4b60
@ -29,7 +29,7 @@ if SpaceVim#layers#isLoaded('autocomplete') && get(g:, 'spacevim_autocomplete_me
|
||||
" the last part `bin/ccls` is the same, whereas the commands are not
|
||||
" actually the same.
|
||||
" We need to keep an id to distinguish among conflicting keys.
|
||||
|
||||
|
||||
if stridx(a:cmds[0], '.') >= 0
|
||||
let l:key = split(a:cmds[0], "\\.")[-1]
|
||||
else
|
||||
@ -103,6 +103,14 @@ elseif has('nvim')
|
||||
call LanguageClient_textDocument_definition()
|
||||
endfunction
|
||||
|
||||
function! SpaceVim#lsp#go_to_typedef() abort
|
||||
call LanguageClient_textDocument_typeDefinition()
|
||||
endfunction
|
||||
|
||||
function! SpaceVim#lsp#go_to_impl() abort
|
||||
call LanguageClient_textDocument_implementation()
|
||||
endfunction
|
||||
|
||||
function! SpaceVim#lsp#rename() abort
|
||||
call LanguageClient_textDocument_rename()
|
||||
endfunction
|
||||
@ -110,6 +118,18 @@ elseif has('nvim')
|
||||
function! SpaceVim#lsp#references() abort
|
||||
call LanguageClient_textDocument_references()
|
||||
endfunction
|
||||
|
||||
function! SpaceVim#lsp#go_to_declaration() abort
|
||||
call LanguageClient_textDocument_declaration()
|
||||
endfunction
|
||||
|
||||
function! SpaceVim#lsp#documentSymbol()
|
||||
call LanguageClient_textDocument_documentSymbol()
|
||||
endfunction
|
||||
|
||||
function! SpaceVim#lsp#refactor() abort
|
||||
" @todo languageclient do not support refactor
|
||||
endfunction
|
||||
else
|
||||
" use vim-lsp
|
||||
function! SpaceVim#lsp#reg_server(ft, cmds) abort
|
||||
|
Loading…
Reference in New Issue
Block a user