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
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion book/src/themes.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,9 @@ We use a similar set of scopes as
- `operator` - `or`, `in`
- `directive` - Preprocessor directives (`#if` in C)
- `function` - `fn`, `func`
- `storage` - Keywords that affect the storage of a variable, function or data structure `static`, `mut`, `const`, `ref`
- `storage` - Keywords describing how things are stored
- `type` - The type of something, `class`, `function`, `var`, `let`, etc.
- `modifier` - Storage modifiers like `static`, `mut`, `const`, `ref`, etc.

- `operator` - `||`, `+=`, `>`

Expand Down
19 changes: 13 additions & 6 deletions runtime/queries/javascript/highlights.scm
Original file line number Diff line number Diff line change
Expand Up @@ -163,31 +163,32 @@
[
"as"
"async"
"class"
"const"
"debugger"
"delete"
"export"
"extends"
"from"
"function"
"get"
"import"
"in"
"instanceof"
"let"
"new"
"of"
"set"
"static"
"target"
"try"
"typeof"
"var"
"void"
"with"
] @keyword

[
"class"
"let"
"const"
"var"
] @keyword.storage.type
the-mikedavis marked this conversation as resolved.
Show resolved Hide resolved

[
"switch"
"case"
Expand All @@ -206,3 +207,9 @@
"do"
"await"
] @keyword.control

[
"import"
"export"
] @keyword.control.import

16 changes: 11 additions & 5 deletions runtime/queries/typescript/highlights.scm
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,21 @@
[
"abstract"
"declare"
"enum"
"export"
"implements"
"interface"
"keyof"
"namespace"
] @keyword

[
"type"
"interface"
"enum"
] @keyword.storage.type

[
"public"
"private"
"protected"
"public"
"type"
"readonly"
] @keyword
] @keyword.storage.modifier
the-mikedavis marked this conversation as resolved.
Show resolved Hide resolved