Skip to content

Commit 0a45b82

Browse files
committed
Improve TS/C# syntax highlighting for this/string/var
1 parent 9e4d20d commit 0a45b82

3 files changed

Lines changed: 9 additions & 9 deletions

File tree

anycode-base/src/langs/csharp.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,8 @@ const query = `
1717
(constructor_declaration name: (identifier) @constructor)
1818
(destructor_declaration name: (identifier) @constructor)
1919
20-
;[
21-
; (implicit_type)
22-
; (predefined_type)
23-
;] @type.builtin
20+
(implicit_type) @keyword
21+
(predefined_type) @type
2422
2523
(_ type: (identifier) @type)
2624
@@ -162,6 +160,7 @@ const query = `
162160
"typeof"
163161
"unchecked"
164162
"using"
163+
"var"
165164
"while"
166165
"new"
167166
"await"
@@ -262,4 +261,4 @@ let comment = "//";
262261

263262
export default {
264263
query, indent, comment
265-
} satisfies Lang
264+
} satisfies Lang

anycode-base/src/langs/typescript.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ const query = `
259259
((identifier) @type
260260
(#match? @type "^[A-Z]"))
261261
(type_identifier) @type
262-
(predefined_type) @type.builtin
262+
(predefined_type) @type
263263
264264
([
265265
(identifier)
@@ -270,8 +270,8 @@ const query = `
270270
271271
; Literals
272272
273-
(this) @variable.special
274-
(super) @variable.special
273+
(this) @variable.builtin
274+
(super) @variable.builtin
275275
276276
[
277277
(null)
@@ -470,4 +470,4 @@ let cmdTest = "npx jest {file} -t \"{test-name}\""
470470

471471
export default {
472472
query, runnablesQuery, executable, cmd, cmdTest, indent, comment
473-
} satisfies Lang
473+
} satisfies Lang

anycode-base/src/theme.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
export let vesper = {
22
"string": "#b1fce5",
33
"variable": "#fff",
4+
"variable.builtin": "#a0a0a0",
45
"function": "#f6c99f",
56
"type": "#f6c99f",
67
"namespace": "#f6c99f",

0 commit comments

Comments
 (0)