saibing / bingo

Bingo is a Go language server that speaks Language Server Protocol.
MIT License
495 stars 25 forks source link

completion of constants includes value #154

Closed joshuarubin closed 5 years ago

joshuarubin commented 5 years ago

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

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

saibing commented 5 years ago

@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.