Closed nabezokodaikon closed 2 years ago
Please understand what you done.
capabilities.textDocument.completion.completionItem.snippetSupport = true
It means you have enabled snippet feature. So it is inserted.
$0
is snippet marker.
You need to disable snippets if you don't want to complete $0
marker.
It was my mistake. Thank you very much.
An error occurred when disabling capabilities.textDocument.completion.completionItem.snippetSupport
.
[denops] [ddc.vim] source: nvim-lsp "gatherCandidates()" is failed
[denops] Error: Failed to call 'call' with ["luaeval","require('ddc_nvim_lsp').request_candidates(_A.arguments, _A.id)",{"arguments":{"textDocument":{"uri":"file:///Users/nabezokodaikon/ws/dev/pcars2-telemetry-browsing/public/index.css"},
"position":{"character":1,"line":12}},"id":"source/nvim-lsp/1"}]: Error: Failed to call 'nvim_call_function' with ["luaeval",["require('ddc_nvim_lsp').request_candidates(_A.arguments, _A.id)",{"arguments":{"textDocument":{"uri":"file:///U
sers/nabezokodaikon/ws/dev/pcars2-telemetry-browsing/public/index.css"},"position":{"character":1,"line":12}},"id":"source/nvim-lsp/1"}]]: [0,"Vim:E5108: Error executing lua ...epos/github.com/Shougo/ddc-nvim-lsp/lua/ddc_nvim_lsp.lua:28:
attempt to get length of local 'map' (a nil value)"]
[denops] at Session.call (https://deno.land/x/msgpack_rpc@v3.1.4/session.ts:207:13)
[denops] at async Service.call (file:///Users/nabezokodaikon/.cache/dein/repos/github.com/vim-denops/denops.vim/denops/@denops-private/service.ts:97:12)
[denops] at async Session.call (file:///Users/nabezokodaikon/.cache/dein/repos/github.com/vim-denops/denops.vim/denops/@denops-private/service.ts:71:16)
[denops] at async Session.dispatch (https://deno.land/x/msgpack_rpc@v3.1.4/session.ts:99:12)
[denops] at async https://deno.land/x/msgpack_rpc@v3.1.4/session.ts:108:18
[denops] at async Session.handleRequest (https://deno.land/x/msgpack_rpc@v3.1.4/session.ts:104:29)
[denops] at Session.call (https://deno.land/x/msgpack_rpc@v3.1.4/session.ts:207:13)
[denops] at async DenopsImpl.call (file:///Users/nabezokodaikon/.cache/dein/repos/github.com/vim-denops/denops.vim/denops/@denops/denops.ts:142:12)
[denops] at async Promise.all (index 1)
[denops] at async Source.gatherCandidates (file:///Users/nabezokodaikon/.cache/dein/repos/github.com/Shougo/ddc-nvim-lsp/denops/@ddc-sources/nvim-lsp.ts:61:23)
[denops] at async callSourceGatherCandidates (file:///Users/nabezokodaikon/.cache/dein/repos/github.com/Shougo/ddc.vim/denops/ddc/ddc.ts:780:12)
[denops] at async file:///Users/nabezokodaikon/.cache/dein/repos/github.com/Shougo/ddc.vim/denops/ddc/ddc.ts:372:21
[denops] at async Promise.all (index 0)
[denops] at async Ddc.gatherResults (file:///Users/nabezokodaikon/.cache/dein/repos/github.com/Shougo/ddc.vim/denops/ddc/ddc.ts:321:16)
[denops] at async doCompletion (file:///Users/nabezokodaikon/.cache/dein/repos/github.com/Shougo/ddc.vim/denops/ddc/app.ts:268:39)
[denops] at async Session.onEvent (file:///Users/nabezokodaikon/.cache/dein/repos/github.com/Shougo/ddc.vim/denops/ddc/app.ts:174:7)
OK. I get the problem. cssls only supports snippet.
Confirmed. Thank you.
@Shougo
I found that the snippets are no longer expanded after the commit a5f9c16 has been merged and the commit includes the comment that says // Note: Does not insert snippet directly
. So is the behavior intentional...?
Actually, I was using the snippets usefully with gopls
which is a language server for Go and supports snippets.
This is intentional behavior. ddc.vim is not snippet plugin. And snippet plugin should not be required.
Note: nvim-cmp
supports the feature, but it requires snippet plugin for the reason.
https://github.com/hrsh7th/nvim-cmp/issues/373
If you need to expand snippets, please install snippet plugin instead.
For example, vim-vsnip
supports the snippet expansion.
@Shougo
Got it, thank you for your kind explanation.
Problems summary
What is the
$0
entered when completing CSS?Expected
Please tell me how to erase
$0
.Environment Information
ddc.vim version (SHA1): 9c43cf1f89136a2b6592e694a693c9676a3ffaa7
ddc-nvim-lsp version (SHA1): 75b53823d900d9be55a77fe2d096d54d0eaa262c
denops.vim version (SHA1): f575cd5c56787b764e064da845b72ceea184ea97
deno version(
deno -V
output): 1.15.1OS: Mac
neovim/Vim
:version
output: 0.5.1:checkhealth
or:CheckHealth
result(neovim only): OKProvide a minimal init.vim/vimrc with less than 50 lines (Required!)
How to reproduce the problem from neovim/Vim startup (Required!)
html:
in the CSS file.{}
.Screenshot (if possible)