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

Comments

@stamblerre
Copy link
Contributor

@stamblerre stamblerre commented Sep 1, 2019

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

@gopherbot gopherbot commented Sep 1, 2019

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 label Sep 1, 2019
@stamblerre stamblerre added help wanted NeedsFix and removed gopls labels Sep 1, 2019
@gopherbot gopherbot added the gopls label Sep 1, 2019
@KarthikNayak
Copy link
Contributor

@KarthikNayak KarthikNayak commented Sep 2, 2019

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

@stamblerre stamblerre commented Sep 3, 2019

@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

@KarthikNayak KarthikNayak commented Sep 7, 2019

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

@KarthikNayak
Copy link
Contributor

@KarthikNayak KarthikNayak commented Oct 5, 2019

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

@danishprakash danishprakash commented Mar 17, 2020

@stamblerre working on this

@clintjedwards
Copy link

@clintjedwards clintjedwards commented Mar 19, 2020

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

@stamblerre stamblerre commented May 6, 2020

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

@stamblerre stamblerre closed this May 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
5 participants
You can’t perform that action at this time.