gitnexus 1.6.6-rc.112 → 1.6.6-rc.113

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) @reference.call.constructor.qualified) @reference.call.constructor
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
@@ -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`. Members are captured as
37
- * `@declaration.property` via the generic property_identifier pattern
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`. Members are captured as
37
- * `@declaration.property` via the generic property_identifier pattern
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) @reference.call.constructor.qualified) @reference.call.constructor
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gitnexus",
3
- "version": "1.6.6-rc.112",
3
+ "version": "1.6.6-rc.113",
4
4
  "description": "Graph-powered code intelligence for AI agents. Index any codebase, query via MCP or CLI.",
5
5
  "author": "Abhigyan Patwari",
6
6
  "license": "PolyForm-Noncommercial-1.0.0",