Skip to content

Commit

Permalink
Introduce storage highlighting for typescript/javascript (#2961)
Browse files Browse the repository at this point in the history
  • Loading branch information
jakenvac committed Jul 6, 2022
1 parent e35abe3 commit 230ba26
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 12 deletions.
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

[
"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

0 comments on commit 230ba26

Please sign in to comment.