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: show hover information for runes #38239
Comments
If this ticket is still up to date, I'd like to implement it. Is that okay if I take it @stamblerre? |
Absolutely, @jhchabran! Please comment here if you need any additional guidance. |
Thanks! I think I need some guidance regarding the marker tests. I wrote some regtests for hovering runes and got them green, but I am unsure how to proceed with the marker tests or even if I should write some for this feature. From what I understand, roughly speaking, the Hovering a rune does not reference anything, so I don't see how I could express that with a marker test, assuming I understood how it presently works. Maybe some self-reference? Do you think I should dig into the markers more and eventually see how they could be made to work with the rune hovering or the regtests would be enough for such an "isolated" feature? |
Thanks for working on this! The regtests might be sufficient for this case, but if you'd like to add marker-based tests, you could also adjust the way that the |
Thanks for the pointer! I spent more time on the markers and got how they work. // internal/lsp/testdata/basiclit/baciclit.go
// (...)
_ = '\U0001F30A' //@hovertooltip("'\\U0001F30A'", "'🌊', U+1F30A, WATER WAVE") Another marker called ➡️ Is that okay to have added another one? I think it makes sense especially if there are other hovers that may be added later on. I also get the feeling that renaming |
Yep, totally fine to add a new marker type! Happy to continue the conversation over a CL. |
Runes expressed in various forms can now be hovered within basic litterals. A quick summary is displayed if a rune is found: a printable version (if it exists), its codepoint and its name. Rune literals always display the summary when hovered, string litterals only display it when a escaped rune sequence is used finally, number litterals only when its expressed as a hexadecimal number whose size ranges from one to eight bytes. Fixes golang/go#38239
Runes expressed in various forms can now be hovered within basic litterals. A quick summary is displayed if a rune is found: a printable version (if it exists), its codepoint and its name. Rune literals always display the summary when hovered, string litterals only display it when a escaped rune sequence is used finally, number litterals only when its expressed as a hexadecimal number whose size ranges from one to eight bytes. Fixes golang/go#38239
Runes expressed in various forms can now be hovered within basic litterals. A quick summary is displayed if a rune is found: a printable version (if it exists), its codepoint and its name. Rune literals always display the summary when hovered, string litterals only display it when a escaped rune sequence is used finally, number litterals only when its expressed as a hexadecimal number whose size ranges from one to eight bytes. Fixes golang/go#38239
Enable to hover runes expressed in various forms within basic literals. A quick summary is displayed if a rune is found: a printable version (if it exists), its codepoint and its name. Rune literals always display the summary when hovered, string literals only display it when an escaped rune sequence is foudn, and number literals only when it is expressed as a hexadecimal number whose size ranges from one to eight bytes. Fixes golang/go#38239
Change https://golang.org/cl/321810 mentions this issue: |
@stamblerre Being the first time I submit a CL, I just wanted to be sure that I am not missing anything that would block the process. Is there something else to do on my part before my CL (see above) gets reviewed ? If not, I'll happily wait until someone reviews it :) |
Thanks for pinging this, @jhchabran! Looks like something went wrong and owners didn't get added as reviewers. I've added myself and will take a look soon. |
From microsoft/vscode-go#3149:
This can be implemented using https://pkg.go.dev/golang.org/x/text/unicode/runenames.
The text was updated successfully, but these errors were encountered: