Browse Source
Merge pull request #12 from blyoa/use-only-server-providing-completion-function
use only a server that is the completion provider
pull/13/head
Shunsuke Kudo
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
13 additions and
1 deletions
-
autoload/ddc_vim_lsp.vim
-
denops/@ddc-sources/vim-lsp.ts
|
|
@ -26,3 +26,15 @@ function! ddc_vim_lsp#request(server_name, id) abort |
|
|
|
\ 'on_notification': function('ddc_vim_lsp#_callback', [l:server, l:position, a:id]), |
|
|
|
\ }) |
|
|
|
endfunction |
|
|
|
|
|
|
|
|
|
|
|
function! ddc_vim_lsp#get_completion_servers() abort |
|
|
|
let l:names = [] |
|
|
|
for l:server_name in lsp#get_allowed_servers() |
|
|
|
let l:capabilities = lsp#get_server_capabilities(l:server_name) |
|
|
|
if has_key(l:capabilities, 'completionProvider') |
|
|
|
call add(l:names, l:server_name) |
|
|
|
endif |
|
|
|
endfor |
|
|
|
return l:names |
|
|
|
endfunction |
|
|
|
|
|
@ -18,7 +18,7 @@ export class Source extends BaseSource<Params> { |
|
|
|
this.counter = (this.counter + 1) % 100; |
|
|
|
|
|
|
|
const lspservers: string[] = await args.denops.call( |
|
|
|
"lsp#get_allowed_servers", |
|
|
|
"ddc_vim_lsp#get_completion_servers", |
|
|
|
// deno-lint-ignore no-explicit-any
|
|
|
|
) as any; |
|
|
|
if (lspservers.length === 0) { |
|
|
|