-
Notifications
You must be signed in to change notification settings - Fork 89
textDocument/completion support via gocode #219
Conversation
Apologies I won't have time today, I've put it onto my TODO list to review on Monday though. |
@keegancsmith That's fine. I also need some time to test the feature with some corner cases as well as with real-world setting. |
vendor import fix included
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So this code assumes that we never have more than one langserver running in a process. However, the only place this isn't true (that I know of) is Sourcegraph.com and we don't do autocompletion on sourcegraph. So this LGTM! Thanks so much for the PR!
@@ -72,6 +73,13 @@ type LangHandler struct { | |||
|
|||
// reset clears all internal state in h. | |||
func (h *LangHandler) reset(init *InitializeParams) error { | |||
for _, k := range init.Capabilities.TextDocument.Completion.CompletionItemKind.ValueSet { | |||
if k == lsp.CIKConstant { | |||
CIKConstantSupported = lsp.CIKConstant |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you are setting a global variable here, but langserver supports multiple instances running at once in the same process.
@ramya-rao-a you may be interested in trying out the completion support in go-langserver this PR added. You need to ensure you are on latest master and run the langserver with the flag Thanks again @Contextualist! |
nice, will give it a try |
This works pretty well, nice job @Contextualist There are a few extra things that the Go extension to VS Code does for completions apart from what |
Support
textDocument/completion
by vendoring nsf/gocode. Gocode maintains a separated package cache, thus this implementation is not optimal for memory.Known issues:
Vendor import gets ignored, probably a bug of gocode (fix vendor import get ignored nsf/gocode#485)Built-in types get ignoredCommit ff980ce also fixes #215 .
This closes #27, closes #77, and closes #201