summaryrefslogtreecommitdiff
path: root/web/assets/typescript.scm
diff options
context:
space:
mode:
Diffstat (limited to 'web/assets/typescript.scm')
-rw-r--r--web/assets/typescript.scm15
1 files changed, 15 insertions, 0 deletions
diff --git a/web/assets/typescript.scm b/web/assets/typescript.scm
new file mode 100644
index 0000000..96cf9c3
--- /dev/null
+++ b/web/assets/typescript.scm
@@ -0,0 +1,15 @@
+; TypeScript highlights, from tree-sitter/tree-sitter-typescript v0.23.2
+; queries/highlights.scm (MIT). A supplement loaded after javascript.scm, as
+; upstream composes it, so these patterns win. Upstream's
+; ((identifier) @type (#match? "^[A-Z]")) is dropped: javascript.scm already
+; paints capitalized identifiers as @constructor, and repainting every one of
+; them as a type costs a second regex per identifier for a worse answer.
+
+["abstract" "declare" "enum" "implements" "interface" "keyof" "namespace"
+ "private" "protected" "public" "type" "readonly" "override"
+ "satisfies"] @keyword
+
+[(type_identifier) (predefined_type)] @type
+(type_arguments "<" @punctuation.bracket ">" @punctuation.bracket)
+(required_parameter (identifier) @variable.parameter)
+(optional_parameter (identifier) @variable.parameter)