Debian Codegraph @

runtime/queries/_typescript/locals.scm

raw symbols SCIP
1 ; Scopes
2 ;-------
3
4 [
5 (type_alias_declaration)
6 (class_declaration)
7 (interface_declaration)
8 ] @local.scope
9
10 ; Definitions
11 ;------------
12
13 (type_parameter
14 name: (type_identifier) @local.definition.type.parameter)
15
16 ; Javascript and Typescript Treesitter grammars deviate when defining the
17 ; tree structure for parameters, so we need to address them in each specific
18 ; language instead of ecma.
19
20 ; (i: t)
21 ; (i: t = 1)
22 (required_parameter
23 (identifier) @local.definition.variable.parameter)
24
25 ; (i?: t)
26 ; (i?: t = 1) // Invalid but still possible to highlight.
27 (optional_parameter
28 (identifier) @local.definition.variable.parameter)
29
30 ; References
31 ;-----------
32
33 (type_identifier) @local.reference
34 (identifier) @local.reference