gitnexus 1.6.6-rc.112 → 1.6.6-rc.114
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -439,7 +439,8 @@ const JAVASCRIPT_SCOPE_QUERY = `
|
|
|
439
439
|
constructor: (identifier) @reference.name) @reference.call.constructor
|
|
440
440
|
|
|
441
441
|
(new_expression
|
|
442
|
-
constructor: (member_expression
|
|
442
|
+
constructor: (member_expression
|
|
443
|
+
property: (property_identifier) @reference.name) @reference.call.constructor.qualified) @reference.call.constructor
|
|
443
444
|
|
|
444
445
|
;; Write access: obj.field = value
|
|
445
446
|
(assignment_expression
|
|
@@ -11,11 +11,35 @@ const PYTHON_SCOPE_QUERY = `
|
|
|
11
11
|
(module) @scope.module
|
|
12
12
|
(class_definition) @scope.class
|
|
13
13
|
(function_definition) @scope.function
|
|
14
|
+
(lambda) @scope.function
|
|
14
15
|
|
|
15
16
|
;; Declarations
|
|
16
17
|
(class_definition
|
|
17
18
|
name: (identifier) @declaration.name) @declaration.class
|
|
18
19
|
|
|
20
|
+
;; Heritage — bare identifier
|
|
21
|
+
;; NOTE: captures.ts on main already synthesizes @reference.inherits for
|
|
22
|
+
;; qualified bases via #1951/#1956. These @heritage.* patterns are redundant
|
|
23
|
+
;; with that synthesis but kept as documentation and a safety net for the
|
|
24
|
+
;; generic heritage extractor path. They produce topicOf edges that the
|
|
25
|
+
;; resolution pipeline ignores when the synthesis path wins.
|
|
26
|
+
(class_definition
|
|
27
|
+
name: (identifier) @heritage.class
|
|
28
|
+
superclasses: (argument_list
|
|
29
|
+
(identifier) @heritage.extends)) @heritage
|
|
30
|
+
|
|
31
|
+
;; Heritage — qualified base (module.Class)
|
|
32
|
+
(class_definition
|
|
33
|
+
name: (identifier) @heritage.class
|
|
34
|
+
superclasses: (argument_list
|
|
35
|
+
(attribute) @heritage.extends)) @heritage
|
|
36
|
+
|
|
37
|
+
;; Heritage — subscripted/generic base (Generic[T])
|
|
38
|
+
(class_definition
|
|
39
|
+
name: (identifier) @heritage.class
|
|
40
|
+
superclasses: (argument_list
|
|
41
|
+
(subscript) @heritage.extends)) @heritage
|
|
42
|
+
|
|
19
43
|
(function_definition
|
|
20
44
|
name: (identifier) @declaration.name) @declaration.function
|
|
21
45
|
|
|
@@ -232,6 +256,22 @@ const PYTHON_SCOPE_QUERY = `
|
|
|
232
256
|
name: (identifier) @type-binding.name
|
|
233
257
|
return_type: (type) @type-binding.type) @type-binding.return
|
|
234
258
|
|
|
259
|
+
;; Decorators — simple @decorator
|
|
260
|
+
(decorator
|
|
261
|
+
(identifier) @reference.name) @reference.call.free
|
|
262
|
+
|
|
263
|
+
;; Decorators — @obj.decorator (single attribute, identifier receiver)
|
|
264
|
+
(decorator
|
|
265
|
+
(attribute
|
|
266
|
+
object: (identifier) @reference.receiver
|
|
267
|
+
attribute: (identifier) @reference.name)) @reference.call.member
|
|
268
|
+
|
|
269
|
+
;; Decorators — @a.b.decorator (nested attributes)
|
|
270
|
+
(decorator
|
|
271
|
+
(attribute
|
|
272
|
+
object: (attribute) @reference.receiver
|
|
273
|
+
attribute: (identifier) @reference.name)) @reference.call.member
|
|
274
|
+
|
|
235
275
|
;; References — calls
|
|
236
276
|
(call
|
|
237
277
|
function: (identifier) @reference.name) @reference.call.free
|
|
@@ -33,9 +33,8 @@
|
|
|
33
33
|
* same identifier also binds as a parameter in the constructor scope
|
|
34
34
|
* via the normal `required_parameter` → `@type-binding.parameter` path.
|
|
35
35
|
* - **Enum** — dual type+value. Emits `@scope.class` (enum body contains
|
|
36
|
-
* member declarations) + `@declaration.enum`.
|
|
37
|
-
*
|
|
38
|
-
* inside enum_body.
|
|
36
|
+
* member declarations) + `@declaration.enum`. Enum member names
|
|
37
|
+
* are captured via `enum_assignment` (see below).
|
|
39
38
|
*
|
|
40
39
|
* Node types pinned via `scripts/_probe_typescript_grammar.ts`:
|
|
41
40
|
* internal_module, namespace_export, namespace_import, import_specifier,
|
|
@@ -33,9 +33,8 @@
|
|
|
33
33
|
* same identifier also binds as a parameter in the constructor scope
|
|
34
34
|
* via the normal `required_parameter` → `@type-binding.parameter` path.
|
|
35
35
|
* - **Enum** — dual type+value. Emits `@scope.class` (enum body contains
|
|
36
|
-
* member declarations) + `@declaration.enum`.
|
|
37
|
-
*
|
|
38
|
-
* inside enum_body.
|
|
36
|
+
* member declarations) + `@declaration.enum`. Enum member names
|
|
37
|
+
* are captured via `enum_assignment` (see below).
|
|
39
38
|
*
|
|
40
39
|
* Node types pinned via `scripts/_probe_typescript_grammar.ts`:
|
|
41
40
|
* internal_module, namespace_export, namespace_import, import_specifier,
|
|
@@ -82,6 +81,11 @@ const TYPESCRIPT_SCOPE_QUERY = `
|
|
|
82
81
|
(abstract_class_declaration) @scope.class
|
|
83
82
|
(interface_declaration) @scope.class
|
|
84
83
|
(enum_declaration) @scope.class
|
|
84
|
+
;; Class expressions: const Foo = class { ... } / const Foo = class Named { ... }.
|
|
85
|
+
;; tree-sitter-typescript uses (class) (NOT class_expression) -- same node
|
|
86
|
+
;; name as tree-sitter-javascript. The name field is optional (anonymous
|
|
87
|
+
;; class expressions omit it); ScopeExtractor tolerates missing names.
|
|
88
|
+
(class) @scope.class
|
|
85
89
|
|
|
86
90
|
(function_declaration) @scope.function
|
|
87
91
|
(generator_function_declaration) @scope.function
|
|
@@ -386,6 +390,9 @@ const TYPESCRIPT_SCOPE_QUERY = `
|
|
|
386
390
|
${ARRAY_METHOD_NOT_ANY_OF_PREDICATE})
|
|
387
391
|
|
|
388
392
|
;; Method definitions — regular + private (#field) methods.
|
|
393
|
+
;; These match inside both class_declaration and class (class expression)
|
|
394
|
+
;; bodies. The @scope.class for class expressions (see (class) above)
|
|
395
|
+
;; ensures methods inside class expressions get the correct Class scope parent.
|
|
389
396
|
(method_definition
|
|
390
397
|
name: (property_identifier) @declaration.name) @declaration.method
|
|
391
398
|
|
|
@@ -407,6 +414,15 @@ const TYPESCRIPT_SCOPE_QUERY = `
|
|
|
407
414
|
(public_field_definition
|
|
408
415
|
name: (private_property_identifier) @declaration.name) @declaration.property
|
|
409
416
|
|
|
417
|
+
;; Enum members: enum Color { Red, Green = 1, Blue }.
|
|
418
|
+
;; Bare members (no value): Red, Blue — property_identifier inside enum_body.
|
|
419
|
+
;; Members with value: Green = 1 — enum_assignment with name field.
|
|
420
|
+
(enum_body
|
|
421
|
+
(property_identifier) @declaration.name) @declaration.property
|
|
422
|
+
|
|
423
|
+
(enum_assignment
|
|
424
|
+
name: (_) @declaration.name) @declaration.property
|
|
425
|
+
|
|
410
426
|
;; Declarations — parameter properties: \`constructor(public name: string)\`.
|
|
411
427
|
;; The accessibility_modifier presence distinguishes these from regular
|
|
412
428
|
;; parameters. The identifier is also bound as a parameter in the
|
|
@@ -528,6 +544,26 @@ const TYPESCRIPT_SCOPE_QUERY = `
|
|
|
528
544
|
type: (type_annotation
|
|
529
545
|
(generic_type) @type-binding.type)) @type-binding.parameter
|
|
530
546
|
|
|
547
|
+
(optional_parameter
|
|
548
|
+
pattern: (identifier) @type-binding.name
|
|
549
|
+
type: (type_annotation
|
|
550
|
+
(predefined_type) @type-binding.type)) @type-binding.parameter
|
|
551
|
+
|
|
552
|
+
(optional_parameter
|
|
553
|
+
pattern: (identifier) @type-binding.name
|
|
554
|
+
type: (type_annotation
|
|
555
|
+
(union_type) @type-binding.type)) @type-binding.parameter
|
|
556
|
+
|
|
557
|
+
(optional_parameter
|
|
558
|
+
pattern: (identifier) @type-binding.name
|
|
559
|
+
type: (type_annotation
|
|
560
|
+
(array_type) @type-binding.type)) @type-binding.parameter
|
|
561
|
+
|
|
562
|
+
(optional_parameter
|
|
563
|
+
pattern: (identifier) @type-binding.name
|
|
564
|
+
type: (type_annotation
|
|
565
|
+
(readonly_type) @type-binding.type)) @type-binding.parameter
|
|
566
|
+
|
|
531
567
|
;; Type bindings — variable annotations: \`let u: User = ...\` / \`const u: User\`.
|
|
532
568
|
(variable_declarator
|
|
533
569
|
name: (identifier) @type-binding.name
|
|
@@ -927,7 +963,8 @@ const TYPESCRIPT_SCOPE_QUERY = `
|
|
|
927
963
|
constructor: (identifier) @reference.name) @reference.call.constructor
|
|
928
964
|
|
|
929
965
|
(new_expression
|
|
930
|
-
constructor: (member_expression
|
|
966
|
+
constructor: (member_expression
|
|
967
|
+
property: (property_identifier) @reference.name) @reference.call.constructor.qualified) @reference.call.constructor
|
|
931
968
|
|
|
932
969
|
;; References — write access: \`obj.field = value\`.
|
|
933
970
|
(assignment_expression
|
package/package.json
CHANGED