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: use static modifier for unexported function/method semantic tokens #51154

Open
segevda opened this issue Feb 11, 2022 · 4 comments
Open
Assignees
Labels
FeatureRequest gopls Tools

Comments

@segevda
Copy link

@segevda segevda commented Feb 11, 2022

Suggesting to use the static modifier for function / method semantic tokens. This will allow finer grained color customization:

static

This customization exists in proprietary IDE's like JetBrains GoLand, and can later be expanded to distinguish unexported types/variables/consts/etc from exported ones.

@gopherbot gopherbot added Tools gopls labels Feb 11, 2022
@gopherbot gopherbot added this to the Unreleased milestone Feb 11, 2022
@findleyr
Copy link
Contributor

@findleyr findleyr commented Feb 11, 2022

@pjweinb pjweinb self-assigned this Feb 11, 2022
@pjweinb
Copy link

@pjweinb pjweinb commented Feb 11, 2022

This is a plausible improvement. I'll take a look.

@segevda
Copy link
Author

@segevda segevda commented Feb 12, 2022

This is a plausible improvement. I'll take a look.

Thanks @pjweinb . If you find that this is doable, I will be happy to implement the change.

@pjweinb
Copy link

@pjweinb pjweinb commented Feb 14, 2022

(this may be a duplicate; i thought i responded, but it's not here)
The Go language identifies exported (non-static) variables with capitalization, so for most purposes this proposal doesn't add information, although it would make the display more colorful. The place where it would add information is that capitalized variables local to functions or function signatures would be marked static (non-exported). These are rare. To the extent all that is true, I don't think it's worth touching the code at this time, but it would be worth adding a comment to the code, for the next time there's an extensive change, that all non-exported variables should have a 'static' modifier.

@hyangah hyangah removed this from the Unreleased milestone Feb 14, 2022
@hyangah hyangah added this to the gopls/unplanned milestone Feb 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FeatureRequest gopls Tools
Projects
None yet
Development

No branches or pull requests

5 participants