-
Notifications
You must be signed in to change notification settings - Fork 18k
x/tools/gopls: autocomplete in comments #34010
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
Comments
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. |
I want to pick this up, but I'm not familiar with the |
@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. |
@stamblerre Thanks for the heads up. I'll contact you if I need any clarifications! |
@stamblerre I see that @clintjedwards has raised a PR for this, I'm glad he got to it before me! |
@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. |
@stamblerre working on this |
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 |
@clintjedwards implemented the remaining changes for this in https://golang.org/cl/230215/. Closing this as a result. Thanks! |
Suggest the name of the symbol when writing the beginning of a comment for an exported symbol. For example:
The above should offer a completion for
Foo
.The text was updated successfully, but these errors were encountered: