on master help sign in
Introduce storage highlighting for typescript/javascript (#2961)
230ba26Jake Langford
book/src/themes.md+3−1
@@ -151,7 +151,9 @@ We use a similar set of scopes as
151 - `operator` - `or`, `in`
151 - `operator` - `or`, `in`
152 - `directive` - Preprocessor directives (`#if` in C)
152 - `directive` - Preprocessor directives (`#if` in C)
153 - `function` - `fn`, `func`
153 - `function` - `fn`, `func`
154− - `storage` - Keywords that affect the storage of a variable, function or data structure `static`, `mut`, `const`, `ref`
154+ - `storage` - Keywords describing how things are stored
155+ - `type` - The type of something, `class`, `function`, `var`, `let`, etc.
156+ - `modifier` - Storage modifiers like `static`, `mut`, `const`, `ref`, etc.
155
157
156- `operator` - `||`, `+=`, `>`
158- `operator` - `||`, `+=`, `>`
157
159
runtime/queries/javascript/highlights.scm+13−6
@@ -163,19 +163,14 @@
163[
163[
164 "as"
164 "as"
165 "async"
165 "async"
166− "class"
167− "const"
168 "debugger"
166 "debugger"
169 "delete"
167 "delete"
170− "export"
171 "extends"
168 "extends"
172 "from"
169 "from"
173 "function"
170 "function"
174 "get"
171 "get"
175− "import"
176 "in"
172 "in"
177 "instanceof"
173 "instanceof"
178− "let"
179 "new"
174 "new"
180 "of"
175 "of"
181 "set"
176 "set"
@@ -183,11 +178,17 @@
183 "target"
178 "target"
184 "try"
179 "try"
185 "typeof"
180 "typeof"
186− "var"
187 "void"
181 "void"
188 "with"
182 "with"
189] @keyword
183] @keyword
190
184
185+[
186+ "class"
187+ "let"
188+ "const"
189+ "var"
190+] @keyword.storage.type
191+
191[
192[
192 "switch"
193 "switch"
193 "case"
194 "case"
@@ -206,3 +207,9 @@
206 "do"
207 "do"
207 "await"
208 "await"
208] @keyword.control
209] @keyword.control
210+
211+[
212+ "import"
213+ "export"
214+] @keyword.control.import
215+
runtime/queries/typescript/highlights.scm+11−5
@@ -22,15 +22,21 @@
22[
22[
23 "abstract"
23 "abstract"
24 "declare"
24 "declare"
25− "enum"
26 "export"
25 "export"
27 "implements"
26 "implements"
28− "interface"
29 "keyof"
27 "keyof"
30 "namespace"
28 "namespace"
29+] @keyword
30+
31+[
32+ "type"
33+ "interface"
34+ "enum"
35+] @keyword.storage.type
36+
37+[
38+ "public"
31 "private"
39 "private"
32 "protected"
40 "protected"
33− "public"
34− "type"
35 "readonly"
41 "readonly"
36−] @keyword
42+] @keyword.storage.modifier