Skip to content

Commit

Permalink
force some capabilities to be enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
tsukkee authored and mattn committed Oct 17, 2022
1 parent e21654c commit 9d050e9
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions settings/volar-server.vim
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,22 @@ augroup vim_lsp_settings_volar_server
\ 'config': lsp_settings#get('volar-server', 'config', lsp_settings#server_config('volar-server')),
\ }
augroup END

function! s:on_lsp_buffer_enabled() abort
" Force some capabilities to be enabled.
" These capabilities are expected to be registered by dynamic registration
" by vim-lsp, but are registered statically by volar.
" cf. https://github.com/prabirshrestha/vim-lsp/pull/1379
let l:capabilities = lsp#get_server_capabilities('volar-server')
if !empty(l:capabilities)
let l:capabilities.callHierarcyProvider = v:true
let l:capabilities.renameProvider = {'prepareProvider': v:true}
let l:capabilities.signatureHelpProvider = v:true
let l:capabilities.workspaceSymbolProvider = v:true
endif
endfunction

augroup lsp_install_volar_server
au!
autocmd User lsp_buffer_enabled call s:on_lsp_buffer_enabled()
augroup END

0 comments on commit 9d050e9

Please sign in to comment.