diff options
Diffstat (limited to 'runtime/queries/_typescript')
-rw-r--r-- | runtime/queries/_typescript/highlights.scm | 2 | ||||
-rw-r--r-- | runtime/queries/_typescript/locals.scm | 17 |
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 |