Closed haruyama closed 1 year ago
Minimal vimrc.
set nocompatible
set runtimepath+=~/work/denops.vim
set runtimepath+=~/work/ddc.vim
set runtimepath+=~/work/ddc-filter-matcher_head
set runtimepath+=~/work/ddc-filter-sorter_rank
set runtimepath+=~/work/ddc-ui-native
set runtimepath+=~/work/ddc-source-nvim-lsp
set runtimepath+=~/src/nvim-lspconfig
lua << EOF
local capabilities = vim.lsp.protocol.make_client_capabilities()
capabilities.textDocument.completion.completionItem.snippetSupport = true
local lspconfig = require'lspconfig'
lspconfig.gopls.setup{capabilities = capabilities}
EOF
call ddc#custom#patch_global(
\ 'sources', ['nvim-lsp']
\ )
call ddc#custom#patch_global('ui', 'native')
call ddc#custom#patch_global('sourceOptions', {
\ '_': {
\ 'matchers': ['matcher_head'],
\ 'sorters': ['sorter_rank'],
\ },
\ 'nvim-lsp': {
\ 'mark': 'lsp',
\ 'forceCompletionPattern': '\.\w*|:\w*|->\w*',
\ },
\ })
call ddc#enable()
Hi. I have tested it and empty items. (I don't reproduce your error)
It is from capabilities.textDocument.completion.completionItem.snippetSupport = true
.
gopls
returns snippet items and it is filtered.
Because you don't set snippetEngine
param.
{
label: "fmt",
textEdit: { range: { end: [Object], start: [Object] }, newText: "fmt" },
filterText: "fmt",
preselect: true,
sortText: "00000",
kind: 9,
detail: '"fmt"',
documentation: { kind: "markdown", value: "" },
insertTextFormat: 2
},
insertTextFormat: 2
means snippet.
First of all, the basic premise is that a major renovation has recently taken place; please re-read the doc.
And to solve this case1, register snippetEngine (:h ddc-source-nvim-lsp-param-snippetEngine
).
gopls returns all candidates as a snippet if snippet=true
. So, if the snippetEngine is not registered, they will be filtered. If you don't want to use the snippet plugin, one solution is to change capabilities.
local capabilities = require('ddc_nvim_lsp').make_client_capabilities()
capabilities.textDocument.completion.completionItem.snippetSupport = false
error messages in :messages
I think the error message is from older commit. It is bug and it is already fixed. So the items are filtered.
I have updated FAQ.
The issue is improved. Please update.
prerequisite
Software version
Other
Steps to reproduce
case 1
https://github.com/Shougo/ddc-source-nvim-lsp/commit/70086994e3d83e65eb4aed6888b84d4b0b2f3aeb
fmt.P
in main functionno candidates are displayed from ddc.
no error messages in :messages
case 2
https://github.com/Shougo/ddc-source-nvim-lsp/commit/738b86b5c16ee8f396d9437e6aea17780e325ef1
fmt.P
andCtrl-N
and(
in main functionfmt.(
is displayed. (expected:fmt.Println(
)error messages in :messages