aboutsummaryrefslogtreecommitdiff
path: root/runtime/queries/_typescript
diff options
context:
space:
mode:
authorJoey Hain2023-11-06 01:54:25 +0000
committerGitHub2023-11-06 01:54:25 +0000
commitf73e9a8d15fd5a87d472a49808baf42ba403f9bf (patch)
treec57d8b378ef5877a5f2894b2dc6845b28bffdbbf /runtime/queries/_typescript
parenta98ad137f9b0678ce9770aaa56a8bf8ca7c51d17 (diff)
highlights: add type.parameter scope to several more languages (#8718)
* typescript * go * haskell * ocaml * kotlin (+ bugfix)
Diffstat (limited to 'runtime/queries/_typescript')
-rw-r--r--runtime/queries/_typescript/highlights.scm2
-rw-r--r--runtime/queries/_typescript/locals.scm17
2 files changed, 19 insertions, 0 deletions
diff --git a/runtime/queries/_typescript/highlights.scm b/runtime/queries/_typescript/highlights.scm
index a83b4347..f9a67266 100644
--- a/runtime/queries/_typescript/highlights.scm
+++ b/runtime/queries/_typescript/highlights.scm
@@ -107,6 +107,8 @@
; Types
; -----
+(type_parameter
+ name: (type_identifier) @type.parameter)
(type_identifier) @type
(predefined_type) @type.builtin
diff --git a/runtime/queries/_typescript/locals.scm b/runtime/queries/_typescript/locals.scm
index fe13f21d..041ad59d 100644
--- a/runtime/queries/_typescript/locals.scm
+++ b/runtime/queries/_typescript/locals.scm
@@ -1,6 +1,18 @@
+; Scopes
+;-------
+
+[
+ (type_alias_declaration)
+ (class_declaration)
+ (interface_declaration)
+] @local.scope
+
; Definitions
;------------
+(type_parameter
+ name: (type_identifier) @local.definition)
+
; Javascript and Typescript Treesitter grammars deviate when defining the
; tree structure for parameters, so we need to address them in each specific
; language instead of ecma.
@@ -14,3 +26,8 @@
; (i?: t = 1) // Invalid but still posible to hihglight.
(optional_parameter
(identifier) @local.definition)
+
+; References
+;-----------
+
+(type_identifier) @local.reference