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: struct tags semantic token should be 'string' type #54066

Closed
hyangah opened this issue Jul 26, 2022 · 2 comments
Closed

x/tools/gopls: struct tags semantic token should be 'string' type #54066

hyangah opened this issue Jul 26, 2022 · 2 comments
Assignees
Labels
FrozenDueToAge gopls Issues related to the Go language server, gopls. Tools This label describes issues relating to any tools in the x/tools repository.
Milestone

Comments

@hyangah
Copy link
Contributor

hyangah commented Jul 26, 2022

Currently gopls classifies struct tags comments as "comment" type token.

Screen Shot 2022-07-26 at 1 10 34 PM

This caused editors using semantic token aware themes color the tags with the same color as comments.

  • Semantic token ON
    Screen Shot 2022-07-26 at 1 07 14 PM

  • Semantic token OFF
    Screen Shot 2022-07-26 at 7 08 26 AM

In TextMate-based grammar rule, vscode classified tags as strings.

According to the language spec, Tag is string_lit, so I think 'string' is more suitable than 'comment' unless there are other standard token types better.

@gopherbot gopherbot added Tools This label describes issues relating to any tools in the x/tools repository. gopls Issues related to the Go language server, gopls. labels Jul 26, 2022
@gopherbot gopherbot added this to the Unreleased milestone Jul 26, 2022
@hyangah hyangah modified the milestones: Unreleased, gopls/later Jul 26, 2022
@gopherbot
Copy link

Change https://go.dev/cl/419498 mentions this issue: internal/lsp: treat struct tags as string type

gopherbot pushed a commit to golang/tools that referenced this issue Jul 26, 2022
For golang/go#54066

Change-Id: Ia4f0bf0b4d76743a7f4fafc375859db7184753fb
Reviewed-on: https://go-review.googlesource.com/c/tools/+/419498
Reviewed-by: Peter Weinberger <pjw@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
gopls-CI: kokoro <noreply+kokoro@google.com>
Run-TryBot: Hyang-Ah Hana Kim <hyangah@gmail.com>
@hyangah hyangah modified the milestones: gopls/later, gopls/v0.9.2 Jul 26, 2022
@hyangah
Copy link
Contributor Author

hyangah commented Jul 26, 2022

After gopls v0.9.2+ semantic token aware themes will present struct tags with a different color.

Screen Shot 2022-07-26 at 4 37 25 PM
.

@hyangah hyangah closed this as completed Jul 26, 2022
@golang golang locked and limited conversation to collaborators Aug 8, 2023
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. Tools This label describes issues relating to any tools in the x/tools repository.
Projects
None yet
Development

No branches or pull requests

2 participants