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: add .if and .not snippets for bool types #47545
Comments
CC @muirdm. |
Thanks for the suggestion. Muir might have some thoughts on this. |
Wanted to add, that we could totally over-engineer the In my mind, for the edge cases: if x == y.not should expand to if x == !y This helps keep the completion snippets more light weight, and if the user so desires, they can get the functionality by surrounding the expression with parentheses, or alternatively manually changing it. |
The I'm less convinced about the |
I don't think this needs to go through the proposal process, so taking it out. Please comment if you disagree. |
The Go parser has trouble with keywords showing up in unexpected/invalid places (i.e. the "if" in
LSP snippets have choices which might allow for a similar experience. But simpler and better, probably, would be just to have gopls offer multiple completion candidates, one for each possibility. Regardless, I would skip |
Sounds good. I will take a stab at it. Will report back if I come across any difficulty |
Is your feature request related to a problem? Please describe. The
introduction of postfix snippets has brought very convenient functionality to
gopls, especially when working outside of Goland. I wanted to contribute more
ideas for postfix completions inspired from what's already available from their
editors. In particular, I wanted to propose having a
if!
andnot!
prompts,which do this (respectively):
Describe the solution you'd like
Implementing these in
completion/postfix_snippets.go
.Describe alternatives you've considered
As a vim developper personally, I use
snippetsEmu. Other
potential alternatives are available in VSCode and Goland.
The text was updated successfully, but these errors were encountered: