saibing / bingo

Bingo is a Go language server that speaks Language Server Protocol.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

completion of constants includes value

joshuarubin opened this issue · comments

I think this is a bingo bug, but feel free to close if it isn't.
Using neovim with:

  • autozimu/LanguageClient-neovim (branch: next)
  • ncm2/ncm2
  • fatih/vim-go

When completing a constant e.g. typing pkg.Fo where there exists const pkg.Foo = "bar" will complete with pkg.Foo = "bar" instead of just pkg.Foo.

This seems related to #15

@joshuarubin

--> request #51: textDocument/completion: {"textDocument":{"uri":"file:///home/saibing/git/go/source/hello/math.go"},"position":{"line":15,"character":7},"context":{"triggerKind":2,"triggerCharacter":"."}}
<-- result #51: textDocument/completion: {"isIncomplete":false,"items":[{"label":"Foo = \"bar\"","kind":21,"detail":"string","sortText":"00000","insertText":"Foo","insertTextFormat":2,"textEdit":{"range":{"start":{"line":15,"character":7},"end":{"line":15,"character":7}},"newText":"Foo"}}]}

bingo's return is ok:

"label": "Foo = \"bar\""
"insertText" = "Foo"
"newText" = "Foo"

coc.nvim, vsocde works well.

Maybe you can try coc.nvim.

I think it better than autozimu/LanguageClient-neovim or ncm2/ncm2.