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

Introduce storage highlighting for typescript/javascript #2961

Merged
merged 3 commits into from
Jul 6, 2022

Conversation

jakenvac
Copy link
Contributor

@jakenvac jakenvac commented Jul 4, 2022

Inspired by and following the patterns of #2731.
Adds keyword.storage.type and keyword.storage.modifier scopes for syntax highlighting.

@the-mikedavis
Copy link
Member

Could you add some docs on the new keys?

- `storage` - Keywords that affect the storage of a variable, function or data structure `static`, `mut`, `const`, `ref`

@jakenvac
Copy link
Contributor Author

jakenvac commented Jul 4, 2022

Could you add some docs on the new keys?

All done. Feedback on the changes are welcome. I've slightly moved around the existing storage description as it was more specific to the modifier sub-scope.

I've added example keywords in rust as that was what was already there, however my personal opinion is that we shouldn't provide language specific examples. For a start I think those keywords are probably not implemented in the rust highlighting query.

I'm also not a rust dev so please let me know if I've misunderstood some of the keywords and they don't fall into the categories I've described.

@archseer archseer requested a review from the-mikedavis July 5, 2022 11:00
Copy link
Member

@the-mikedavis the-mikedavis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

keyword.storage was originally based on Vim's StorageClass highlight group (#2731). I think textmate's use of storage.{type,modifier} is a bit clearer though so let's lean towards those. For consistency though, Rust's const should become keyword.storage.type.

book/src/themes.md Outdated Show resolved Hide resolved
book/src/themes.md Outdated Show resolved Hide resolved
runtime/queries/typescript/highlights.scm Show resolved Hide resolved
@jakenvac jakenvac requested a review from the-mikedavis July 6, 2022 13:09
Copy link
Member

@the-mikedavis the-mikedavis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Thanks!

@the-mikedavis the-mikedavis merged commit 230ba26 into helix-editor:master Jul 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants