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

update go highlight queries #8399

Merged

Conversation

bhainesva
Copy link
Contributor

I've removed the query for all caps vars, because naming variables in this way isn't a go convention, but can relocate it to the bottom of the file as suggested in the issue discussion if that's preferred.

Go Wiki:

See https://go.dev/doc/effective_go#mixed-caps. This applies even when it breaks conventions in other languages. For example an unexported constant is maxLength not MaxLength or MAX_LENGTH.

Google Go Styleguide:

Go source code uses MixedCaps or mixedCaps (camel case) rather than underscores (snake case) when writing multi-word names.

This applies even when it breaks conventions in other languages. For example, a constant is MaxLength (not MAX_LENGTH) if exported and maxLength (not max_length) if unexported.

fixes #8390

add @variable.other.member query for keyed elements
remove special case of all caps vars treated as const

fixes helix-editor#8223
@the-mikedavis the-mikedavis added S-waiting-on-review Status: Awaiting review from a maintainer. A-language-support Area: Support for programming/text languages labels Sep 26, 2023
@pascalkuthe pascalkuthe merged commit 2776233 into helix-editor:master Sep 26, 2023
@bhainesva bhainesva deleted the go-keyed-element-highlights branch September 27, 2023 00:06
danillos pushed a commit to danillos/helix that referenced this pull request Nov 21, 2023
dgkf pushed a commit to dgkf/helix that referenced this pull request Jan 30, 2024
mtoohey31 pushed a commit to mtoohey31/helix that referenced this pull request Jun 2, 2024
smortime pushed a commit to smortime/helix that referenced this pull request Jul 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-language-support Area: Support for programming/text languages S-waiting-on-review Status: Awaiting review from a maintainer.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

go: all-CAPS struct fields are highlighted differently from non-all-CAPS
3 participants