Closed ryan0270 closed 2 years ago
Really? I will test it.
It works for me. It seems your configuration problem.
This is the minimal vimrc. Closing.
if &compatible
set nocompatible
endif
set runtimepath^=~/work/ddc.vim
set runtimepath+=~/work/denops.vim
if has('nvim')
set runtimepath+=~/src/nvim-lspconfig
set runtimepath^=~/work/ddc-nvim-lsp
lua << EOF
require'lspconfig'.clangd.setup{}
EOF
endif
filetype plugin indent on
syntax enable
call ddc#custom#patch_global('sourceOptions', {
\ '_': {
\ 'matchers': ['matcher_head'],
\ 'sorters': ['sorter_rank'],
\ },
\ 'nvim-lsp': {'mark': 'nvimlsp', 'forceCompletionPattern': '\.|:|->|"\w*/'},
\ })
call ddc#custom#patch_filetype(['c'], 'sources', ['nvim-lsp'])
call ddc#enable()
Even with your init.vim
it's still not working for me. The only thing I changed was the paths:
set runtimepath^=~/.cache/dein/repos/github.com/Shougo/ddc.vim
set runtimepath+=~/.cache/dein/repos/github.com/vim-denops/denops.vim
if has('nvim')
set runtimepath+=~/.cache/dein/repos/github.com/neovim/nvim-lspconfig
set runtimepath^=~/.cache/dein/repos/github.com/Shougo/ddc-nvim-lsp
lua << EOF
require'lspconfig'.clangd.setup{}
EOF
endif
Is there a way I can generate debug output? Also, I forgot mention before that I'm on nvim version 0.5.1 if that matters.
You can debug it. It is open source and you can reproduce the problem. It is easy way if I am you.
I cannot debug it. I have not ESP skill.
You should check nvim-lsp
source is really called.
diff --git a/denops/@ddc-sources/nvim-lsp.ts b/denops/@ddc-sources/nvim-lsp.ts
index 838642d..6683547 100644
--- a/denops/@ddc-sources/nvim-lsp.ts
+++ b/denops/@ddc-sources/nvim-lsp.ts
@@ -88,6 +88,7 @@ export class Source extends BaseSource<Params> {
async gatherCandidates(
args: GatherCandidatesArguments<Params>,
): Promise<Candidate[]> {
+ console.log(args.context.input);
const escaped = escapeVimAutoloadNameCached(this.name);
const prevInput = await vars.g.get(
args.denops,
I can confirm that lsp is working by simply adding a syntax error to the file and seeing the lsp error messages appear.
LSP works does not mean ddc-nvim-lsp
works.
Sorry, but I have no experience in debugging (neo)vim plugins so I can't do much without guidance. It took me 30mins just to find how I can see the output of console.log
.
I confirmed that right now it is NOT being called. I tried downgrading neovim to version 0.5.0 and everything works; that log line is being called and I see the lsp completions. So it appears something changed in version 0.5.1.
I use neovim HEAD. It works.
I don't know why neovim 0.5.1 does not work.
I get the reason. neovim 0.5.1 contains LSP breaking changes.
I'm trying to migrate from deoplete to ddc but can't get lsp completions to work. As minimal example, create this file
If I start adding
f.bb
I get the around source completion but not lsp (a better example is to moveFoo
to a separate file and there are no completions). I can confirm that lsp is working by simply adding a syntax error to the file and seeing the lsp error messages appear.Here is my init.vim
and the referenced
init.lua