Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/tools/gopls: autocomplete in comments #34010

Closed
stamblerre opened this issue Sep 1, 2019 · 9 comments
Closed

x/tools/gopls: autocomplete in comments #34010

stamblerre opened this issue Sep 1, 2019 · 9 comments
Labels
FrozenDueToAge gopls Issues related to the Go language server, gopls. help wanted NeedsFix The path to resolution is known, but the work has not been done. Tools This label describes issues relating to any tools in the x/tools repository.

Comments

@stamblerre
Copy link
Contributor

Suggest the name of the symbol when writing the beginning of a comment for an exported symbol. For example:

// <>
var Foo int 

The above should offer a completion for Foo.

@gopherbot gopherbot added this to the Unreleased milestone Sep 1, 2019
@gopherbot
Copy link

Thank you for filing a gopls issue! Please take a look at the Troubleshooting section of the gopls Wiki page, and make sure that you have provided all of the relevant information here.

@gopherbot gopherbot added the gopls Issues related to the Go language server, gopls. label Sep 1, 2019
@stamblerre stamblerre added help wanted NeedsFix The path to resolution is known, but the work has not been done. and removed gopls Issues related to the Go language server, gopls. labels Sep 1, 2019
@gopherbot gopherbot added the gopls Issues related to the Go language server, gopls. label Sep 1, 2019
@KarthikNayak
Copy link
Contributor

I want to pick this up, but I'm not familiar with the gopls codebase, so might take some time.

@stamblerre
Copy link
Contributor Author

@KarthikNayak: The first place to look would be in https://github.com/golang/tools/blob/be0da057c5e3c2df569a2c25cd280149b7d7e7d0/internal/lsp/source/completion.go#L441. I would suggest making a separate function for autocompletion in comments and going from there. Feel free to reach out to me here or on the Gophers Slack if you have any questions on how to move forward with this.

@KarthikNayak
Copy link
Contributor

@stamblerre Thanks for the heads up. I'll contact you if I need any clarifications!

@stamblerre stamblerre added the Tools This label describes issues relating to any tools in the x/tools repository. label Sep 9, 2019
@KarthikNayak
Copy link
Contributor

@stamblerre I see that @clintjedwards has raised a PR for this, I'm glad he got to it before me!

@stamblerre stamblerre modified the milestones: Unreleased, gopls unplanned Dec 4, 2019
@stamblerre stamblerre modified the milestones: gopls unplanned, gopls completion Jan 29, 2020
@stamblerre
Copy link
Contributor Author

stamblerre commented Mar 16, 2020

@clintjedwards implemented this feature for exported variables, but this still needs to be added for exported functions, constants, and types if anyone is interested in working on this.

@danishprakash
Copy link

@stamblerre working on this

@clintjedwards
Copy link

Shouldn't be too bad, the code just checks for VAR type and then throws out the rest. Should be a few lines change at most, not counting tests ;)

Let me know if you have questions @danishprakash

@stamblerre
Copy link
Contributor Author

@clintjedwards implemented the remaining changes for this in https://golang.org/cl/230215/. Closing this as a result. Thanks!

@golang golang locked and limited conversation to collaborators May 6, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge gopls Issues related to the Go language server, gopls. help wanted NeedsFix The path to resolution is known, but the work has not been done. Tools This label describes issues relating to any tools in the x/tools repository.
Projects
None yet
Development

No branches or pull requests

5 participants