gitnexus 1.6.10-rc.113 → 1.6.10-rc.115

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.
Files changed (44) hide show
  1. package/dist/_shared/scope-resolution/registries/lookup-core.js +7 -0
  2. package/dist/_shared/scope-resolution/registries/lookup-core.js.map +1 -1
  3. package/dist/_shared/scope-resolution/types.d.ts +13 -0
  4. package/dist/_shared/scope-resolution/types.d.ts.map +1 -1
  5. package/dist/core/ingestion/language-provider.d.ts +13 -0
  6. package/dist/core/ingestion/languages/dart/captures.js +28 -1
  7. package/dist/core/ingestion/languages/dart/query.js +31 -0
  8. package/dist/core/ingestion/languages/javascript/captures.d.ts +3 -0
  9. package/dist/core/ingestion/languages/javascript/captures.js +41 -1
  10. package/dist/core/ingestion/languages/javascript/query.d.ts +1 -0
  11. package/dist/core/ingestion/languages/javascript/query.js +20 -5
  12. package/dist/core/ingestion/languages/php/query.js +14 -0
  13. package/dist/core/ingestion/languages/typescript/captures.d.ts +4 -0
  14. package/dist/core/ingestion/languages/typescript/captures.js +58 -1
  15. package/dist/core/ingestion/languages/typescript/query.d.ts +1 -0
  16. package/dist/core/ingestion/languages/typescript/query.js +30 -8
  17. package/dist/core/ingestion/languages/typescript/receiver-binding.d.ts +17 -0
  18. package/dist/core/ingestion/languages/typescript/receiver-binding.js +27 -0
  19. package/dist/core/ingestion/languages/typescript.js +11 -0
  20. package/dist/core/ingestion/scope-extractor.d.ts +1 -1
  21. package/dist/core/ingestion/scope-extractor.js +9 -3
  22. package/dist/core/ingestion/scope-resolution/graph-bridge/ids.d.ts +2 -17
  23. package/dist/core/ingestion/scope-resolution/graph-bridge/ids.js +54 -1
  24. package/dist/core/ingestion/scope-resolution/graph-bridge/node-lookup.d.ts +41 -0
  25. package/dist/core/ingestion/scope-resolution/graph-bridge/node-lookup.js +59 -0
  26. package/dist/core/ingestion/scope-resolution/passes/callable-value-flow.d.ts +10 -0
  27. package/dist/core/ingestion/scope-resolution/passes/callable-value-flow.js +94 -12
  28. package/dist/core/ingestion/scope-resolution/passes/receiver-bound-calls.js +22 -1
  29. package/dist/core/ingestion/scope-resolution/resolution-outcome.d.ts +5 -1
  30. package/dist/core/ingestion/scope-resolution/scope/walkers.d.ts +29 -0
  31. package/dist/core/ingestion/scope-resolution/scope/walkers.js +48 -0
  32. package/dist/core/ingestion/tree-sitter-queries.d.ts +5 -5
  33. package/dist/core/ingestion/tree-sitter-queries.js +184 -4
  34. package/dist/core/ingestion/type-env.js +11 -7
  35. package/dist/core/ingestion/type-extractors/types.d.ts +12 -0
  36. package/dist/core/ingestion/type-extractors/typescript.d.ts +20 -0
  37. package/dist/core/ingestion/type-extractors/typescript.js +26 -0
  38. package/dist/core/ingestion/utils/callable-flow-captures.d.ts +47 -0
  39. package/dist/core/ingestion/utils/callable-flow-captures.js +47 -0
  40. package/dist/core/ingestion/workers/parse-worker.js +169 -6
  41. package/dist/storage/parse-cache.js +33 -6
  42. package/dist/storage/repo-manager.d.ts +33 -2
  43. package/dist/storage/repo-manager.js +32 -1
  44. package/package.json +1 -1
@@ -224,6 +224,13 @@ function lookupReceiverType(startScope, receiverName, ctx) {
224
224
  // intentionally do NOT re-implement a simple-name fallback here.
225
225
  return undefined;
226
226
  }
227
+ // The scope binds this receiver itself but carries no type for it — a
228
+ // JS/TS ordinary `function` whose `this` is bound at call time, not the
229
+ // enclosing instance (#2701). Stop rather than borrowing an enclosing
230
+ // scope's binding; see `Scope.ownsReceivers`. Mirrors the same gate in
231
+ // the ingestion-side twin of this walk, `findReceiverTypeBinding`.
232
+ if (scope.ownsReceivers?.has(receiverName) === true)
233
+ return undefined;
227
234
  currentId = scope.parent;
228
235
  }
229
236
  return undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"lookup-core.js","sourceRoot":"","sources":["../../../src/scope-resolution/registries/lookup-core.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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K,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,IAAI,YAAY,EAAE,CAAC;QAC1C,IAAI,KAAK,CAAC,OAAO,CAAC,YAAY,KAAK,cAAc,EAAE,CAAC;YAClD,YAAY,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAC7B,CAAC;IACH,CAAC;AACH,CAAC;AAED,8EAA8E;AAE9E,SAAS,cAAc,CAAC,YAAwC;IAC9D,MAAM,WAAW,GAAiB,EAAE,CAAC;IACrC,MAAM,OAAO,GAAG,IAAI,GAAG,EAAuB,CAAC;IAE/C,KAAK,MAAM,KAAK,IAAI,YAAY,CAAC,MAAM,EAAE,EAAE,CAAC;QAC1C,MAAM,QAAQ,GAAG,eAAe,CAAC,KAAK,CAAC,OAAqB,CAAC,CAAC;QAC9D,MAAM,UAAU,GAAG,sBAAsB,CAAC,QAAQ,CAAC,CAAC;QACpD,WAAW,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,KAAK,CAAC,GAAG,EAAE,UAAU,EAAE,QAAQ,EAAE,CAAC,CAAC;QAC3D,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,EAAE,EAAE,GAAG,KAAK,CAAC,WAAW,EAAE,CAAC,CAAC;IAC1D,CAAC;IAED,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,gCAAgC,CAAC,CAAC,EAAE,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC;IAC5E,OAAO,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;AACpC,CAAC;AAED,+EAA+E;AAE/E,MAAM,KAAK,GAA0B,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC"}
@@ -354,6 +354,19 @@ export interface Scope {
354
354
  readonly imports: readonly ImportEdge[];
355
355
  /** Local type facts visible from this scope (parameter annotations, `self` binding, etc.). */
356
356
  readonly typeBindings: ReadonlyMap<string, TypeRef>;
357
+ /** Receiver names this scope BINDS rather than inherits — `this`, `self`, … (#2701).
358
+ *
359
+ * A receiver walk (`findReceiverTypeBinding`) that reaches such a scope
360
+ * without finding the name in `typeBindings` stops here and reports the
361
+ * receiver unresolved, instead of continuing up and borrowing an enclosing
362
+ * scope's binding. In JavaScript/TypeScript an ordinary `function` binds its
363
+ * own `this` (ECMA-262 `[[ThisMode]]`) while an arrow inherits one, so
364
+ * `this.m()` inside a nested `function` must NOT reach the enclosing class.
365
+ *
366
+ * Left unset by every language whose closures capture the receiver
367
+ * lexically, which is nearly all of them — the walk is unchanged there.
368
+ * Populated from `LanguageProvider.scopeOwnsReceivers`. */
369
+ readonly ownsReceivers?: ReadonlySet<string>;
357
370
  }
358
371
  /**
359
372
  * One piece of evidence for a `Resolution`. Multiple signals corroborate a
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/scope-resolution/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAI/D,4FAA4F;AAC5F,MAAM,MAAM,OAAO,GAAG,MAAM,CAAC;AAE7B,0DAA0D;AAC1D,MAAM,MAAM,KAAK,GAAG,MAAM,CAAC;AAE3B;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,SAAS,GACjB,QAAQ,GACR,WAAW,GACX,OAAO,GACP,UAAU,GACV,OAAO,GACP,YAAY,GACZ,QAAQ,CAAC;AAIb,qFAAqF;AACrF,MAAM,WAAW,KAAK;IACpB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED;;;;;;GAMG;AACH,MAAM,WAAW,OAAO;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gE;IAChE,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B;;gFAE4E;IAC5E,QAAQ,CAAC,gBAAgB,CAAC,EAAE;QAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;CACvD"}
@@ -367,6 +367,19 @@ interface LanguageProviderConfig {
367
367
  * suffix — `@scope.function` → `'Function'`, etc.).
368
368
  */
369
369
  readonly resolveScopeKind?: (captures: CaptureMatch) => ScopeKind | null;
370
+ /**
371
+ * Report the receiver names this scope BINDS rather than inherits — see
372
+ * `Scope.ownsReceivers` (#2701).
373
+ *
374
+ * Called once per `@scope.*` capture during scope-tree construction.
375
+ * Return the shared frozen set for a scope that starts a fresh receiver
376
+ * (a JS/TS ordinary `function`, whose `this` is bound at call time), and
377
+ * `undefined` for one that inherits it (an arrow function, and every
378
+ * closure form in languages that capture the receiver lexically).
379
+ *
380
+ * Default: undefined everywhere — the receiver walk is unchanged.
381
+ */
382
+ readonly scopeOwnsReceivers?: (captures: CaptureMatch) => ReadonlySet<string> | undefined;
370
383
  /**
371
384
  * Override where a declaration's name becomes visible. By default the name
372
385
  * is bound in the innermost enclosing scope; return a different `ScopeId`
@@ -47,9 +47,36 @@ const DART_CALLABLE_CAPTURE_OPTIONS = {
47
47
  callNodeTypes: new Set(['selector']),
48
48
  parameterListNodeTypes: new Set(['formal_parameter_list', 'arguments']),
49
49
  parameterNodeTypes: new Set(['formal_parameter']),
50
- bindingNodeTypes: new Set(['initialized_variable_definition']),
50
+ // `initialized_identifier` covers TOP-LEVEL `var` bindings and the second and
51
+ // later declarators of a multi-name local; `static_final_declaration` covers
52
+ // top-level `final`/`const`, which parse into a different list node entirely.
53
+ // Dart wraps only the FIRST local declarator in `initialized_variable_
54
+ // definition`, so without the other two a top-level `var f = (x) => x;`, a
55
+ // `final f = …`, and the `g` of `var f = …, g = …;` all emitted no flow
56
+ // captures at all and never resolved (#2693).
57
+ bindingNodeTypes: new Set([
58
+ 'initialized_variable_definition',
59
+ 'initialized_identifier',
60
+ 'static_final_declaration',
61
+ ]),
51
62
  assignmentNodeTypes: new Set(['assignment_expression']),
52
63
  identifierNodeTypes: new Set(['identifier', 'type_identifier']),
64
+ // `initialized_identifier` and `static_final_declaration` are FIELDLESS, so
65
+ // the shared field-based fallback (`left`/`name`/`value`/…) decomposes
66
+ // nothing and those bindings produced no flow facts at all — the same shape
67
+ // as Kotlin's fieldless `assignment` node. Positional: first named child is
68
+ // the bound name, last is the initializer.
69
+ // `initialized_variable_definition` carries real `name:` / `value:` fields,
70
+ // so it is left to the shared path by returning undefined.
71
+ extractAssignment: (node) => {
72
+ if (node.type !== 'initialized_identifier' && node.type !== 'static_final_declaration') {
73
+ return undefined;
74
+ }
75
+ const named = node.namedChildren.filter((child) => child !== null);
76
+ if (named.length < 2)
77
+ return undefined;
78
+ return { destination: named[0], source: named[named.length - 1] };
79
+ },
53
80
  lexicalFunctionOwner: (node) => dartLexicalFunctionOwner(node),
54
81
  isCallNode: (node) => node.namedChild(0)?.type === 'argument_part',
55
82
  extractCallCallee: (node) => dartCallableCallee(node) ?? undefined,
@@ -124,6 +124,37 @@ const DART_SCOPE_QUERY = `
124
124
  (initialized_identifier
125
125
  . (identifier) @declaration.name))) @declaration.property
126
126
 
127
+ ; ── Declarations — closure bindings (#2693) ──────────────────────────────────
128
+ ; \`var f = (x) => x;\` binds a callable. Without a declaration the binding has
129
+ ; no SymbolDefinition, so callable-value-flow has nothing to attach its seed to
130
+ ; and \`f()\` stays unresolved even though the graph emits a Function node for it.
131
+ ;
132
+ ; Restricted to a function_expression value on purpose: declaring every Dart
133
+ ; variable would mint defs repo-wide for no resolution benefit. The top-level
134
+ ; rule is anchored under (program) — the same disambiguation the graph-node
135
+ ; query uses — so class-body fields, which reuse initialized_identifier_list
136
+ ; and are already @declaration.property, are never matched twice.
137
+ (program
138
+ (initialized_identifier_list
139
+ (initialized_identifier
140
+ (identifier) @declaration.name
141
+ (function_expression))) @declaration.variable)
142
+ (program
143
+ (static_final_declaration_list
144
+ (static_final_declaration
145
+ (identifier) @declaration.name
146
+ (function_expression))) @declaration.variable)
147
+ (initialized_variable_definition
148
+ name: (identifier) @declaration.name
149
+ value: (function_expression)) @declaration.variable
150
+ ; Second and later declarators of \`var f = .., g = ..;\` are nested
151
+ ; initialized_identifier children of the same initialized_variable_definition,
152
+ ; which the field-based rule above only reaches for the first name.
153
+ (initialized_variable_definition
154
+ (initialized_identifier
155
+ (identifier) @declaration.name
156
+ (function_expression)) @declaration.variable)
157
+
127
158
  ; ── Imports / re-exports ─────────────────────────────────────────────────────
128
159
  (import_or_export
129
160
  (library_import
@@ -27,4 +27,7 @@
27
27
  * Pure given the input source text. No I/O, no globals consulted.
28
28
  */
29
29
  import type { CaptureMatch } from '../../../../_shared/index.js';
30
+ /** JS function-like node types that may carry a synthesized `this` binding.
31
+ * Kept in sync with the `@scope.function` patterns in `query.ts`. */
32
+ export declare const FUNCTION_NODE_TYPES: readonly ["method_definition", "arrow_function", "function_expression", "function_declaration", "generator_function_declaration", "generator_function"];
30
33
  export declare function emitJsScopeCaptures(sourceText: string, filePath: string, cachedTree?: unknown): readonly CaptureMatch[];
@@ -38,13 +38,41 @@ import { synthesizeCallableFlowCaptures } from '../../utils/callable-flow-captur
38
38
  import { deriveDefaultExportHocName, isBlockedDefaultExportHoc, isDefaultExportHocFunctionNode, } from '../../ts-js-hoc-utils.js';
39
39
  /** JS function-like node types that may carry a synthesized `this` binding.
40
40
  * Kept in sync with the `@scope.function` patterns in `query.ts`. */
41
- const FUNCTION_NODE_TYPES = [
41
+ export const FUNCTION_NODE_TYPES = [
42
42
  'method_definition',
43
43
  'arrow_function',
44
44
  'function_expression',
45
45
  'function_declaration',
46
46
  'generator_function_declaration',
47
+ // The EXPRESSION form (`const g = function* () {}`) — see the matching note
48
+ // in `typescript/captures.ts`.
49
+ 'generator_function',
47
50
  ];
51
+ /** Nodes whose `statement_block` child is their BODY, not a nested block. */
52
+ const JS_FUNCTION_BODY_OWNER_TYPES = new Set(FUNCTION_NODE_TYPES);
53
+ /** Direct-child node types that create a BINDING in their enclosing block.
54
+ * `variable_declaration` (`var`) is deliberately absent: it hoists past the
55
+ * block to the function, so a block containing only `var` binds nothing. */
56
+ const BLOCK_BINDING_CHILD_TYPES = new Set([
57
+ 'lexical_declaration',
58
+ 'class_declaration',
59
+ 'function_declaration',
60
+ 'generator_function_declaration',
61
+ ]);
62
+ /** True when `block` directly declares a name, i.e. it is a real environment
63
+ * record rather than punctuation. A block that binds nothing is transparent to
64
+ * every scope-chain walk — a lookup finds nothing in it and continues to the
65
+ * parent — so emitting a scope for it costs tree size and walk depth and buys
66
+ * exactly nothing. Only DIRECT children count: a declaration in a nested block
67
+ * belongs to that block, which gets its own scope by the same rule. */
68
+ const blockDeclaresBinding = (block) => {
69
+ for (let i = 0; i < block.namedChildCount; i++) {
70
+ const child = block.namedChild(i);
71
+ if (child !== null && BLOCK_BINDING_CHILD_TYPES.has(child.type))
72
+ return true;
73
+ }
74
+ return false;
75
+ };
48
76
  /** Declaration anchors that carry function-like arity metadata. */
49
77
  const FUNCTION_DECL_TAGS = ['@declaration.method', '@declaration.function'];
50
78
  /** Callsite anchors that should carry `@reference.arity` + param types. */
@@ -759,6 +787,18 @@ export function emitJsScopeCaptures(sourceText, filePath, cachedTree) {
759
787
  continue;
760
788
  }
761
789
  // Filter @reference.read.member false-positives.
790
+ // See the matching filter in typescript/captures.ts: a `statement_block`
791
+ // that IS a function body duplicates the enclosing Function scope, and
792
+ // keeping it puts a redundant level inside every function for every
793
+ // scope-chain walk to step through (~6% of analyze wall time, measured).
794
+ if (grouped['@scope.block'] !== undefined) {
795
+ const blockNode = groupedNodes['@scope.block'];
796
+ const parentType = blockNode?.parent?.type;
797
+ if (parentType !== undefined && JS_FUNCTION_BODY_OWNER_TYPES.has(parentType))
798
+ continue;
799
+ if (blockNode === undefined || !blockDeclaresBinding(blockNode))
800
+ continue;
801
+ }
762
802
  if (grouped['@reference.read.member'] !== undefined) {
763
803
  const anchor = grouped['@reference.read.member'];
764
804
  const memberNode = findSelfOrAncestorOfType(groupedNodes['@reference.read.member'], 'member_expression') ??
@@ -46,6 +46,7 @@
46
46
  * tree-sitter init cost per file.
47
47
  */
48
48
  import Parser from 'tree-sitter';
49
+ export declare const JAVASCRIPT_SCOPE_QUERY: string;
49
50
  export declare function getJsParser(filePath?: string): Parser;
50
51
  export declare function getJsScopeQuery(filePath?: string): Parser.Query;
51
52
  /** Validate that a cached Tree was produced by the JS grammar. */
@@ -53,18 +53,23 @@ const JS_GRAMMAR = JS;
53
53
  function isJsxFile(filePath) {
54
54
  return filePath.endsWith('.jsx');
55
55
  }
56
- const JAVASCRIPT_SCOPE_QUERY = `
56
+ export const JAVASCRIPT_SCOPE_QUERY = `
57
57
  ;; Scopes — module / class-likes / function-likes
58
58
  (program) @scope.module
59
59
 
60
60
  (class_declaration) @scope.class
61
61
  (class) @scope.class
62
62
 
63
- (function_declaration) @scope.function
64
- (generator_function_declaration) @scope.function
65
- (function_expression) @scope.function
63
+ ;; \`@receiver-owner.this\` — see the matching block in typescript/query.ts
64
+ ;; (#2701). Every function form except \`arrow_function\` binds its own \`this\`.
65
+ (function_declaration) @scope.function @receiver-owner.this
66
+ (generator_function_declaration) @scope.function @receiver-owner.this
67
+ (function_expression) @scope.function @receiver-owner.this
68
+ ;; \`function*(){}\` as an EXPRESSION. Absent from this list before #2701, so it
69
+ ;; was not a scope at all and \`this\` inside one read as the enclosing method's.
70
+ (generator_function) @scope.function @receiver-owner.this
66
71
  (arrow_function) @scope.function
67
- (method_definition) @scope.function
72
+ (method_definition) @scope.function @receiver-owner.this
68
73
 
69
74
  ;; Object literals get their own scope boundary -- see the matching
70
75
  ;; comment in typescript/query.ts (#2545/#2551). Prevents a
@@ -73,6 +78,16 @@ const JAVASCRIPT_SCOPE_QUERY = `
73
78
  ;; sibling properties from seeing each other as bare identifiers.
74
79
  (object) @scope.object
75
80
 
81
+ ;; Statement blocks are BINDING scopes (#2699). ECMAScript gives every block its
82
+ ;; own environment record, so \`let\`/\`const\`/\`class\`/\`function\` declared in
83
+ ;; sibling blocks of one function are DIFFERENT bindings — without this the
84
+ ;; resolver sees both as function-level and a call in one branch resolves to
85
+ ;; both. \`tsBindingScopeFor\` already implements the other half of the rule:
86
+ ;; \`var\` hoists past blocks to the enclosing Function/Module, \`let\`/\`const\`
87
+ ;; take the innermost scope, which is now the block.
88
+ (statement_block) @scope.block
89
+
90
+
76
91
  ;; Declarations — classes
77
92
  (class_declaration
78
93
  name: (identifier) @declaration.name) @declaration.class
@@ -104,6 +104,20 @@ const PHP_SCOPE_QUERY = `
104
104
  (property_element
105
105
  name: (variable_name) @declaration.name)) @declaration.variable
106
106
 
107
+ ;; ── Declarations — closure bindings (#2693) ───────────────────────────────
108
+ ;; A dollar-name bound to a closure (fn(x) => x, or function(x){...}) IS a
109
+ ;; callable. PHP emitted the callable-flow seed and invoke for it already, but
110
+ ;; nothing DECLARED the name, so the flow pass had no SymbolDefinition to attach
111
+ ;; the seed to and the call stayed unresolved.
112
+ ;; Restricted to a closure value: declaring every PHP assignment would mint defs
113
+ ;; repo-wide for no resolution benefit.
114
+ (assignment_expression
115
+ left: (variable_name (name) @declaration.name)
116
+ right: (arrow_function)) @declaration.variable
117
+ (assignment_expression
118
+ left: (variable_name (name) @declaration.name)
119
+ right: (anonymous_function)) @declaration.variable
120
+
107
121
  ;; ── Imports — namespace_use_declaration ───────────────────────────────────
108
122
  ;;
109
123
  ;; Captures ALL forms: plain, alias, function/const qualifiers, and grouped.
@@ -25,4 +25,8 @@
25
25
  * Pure given the input source text. No I/O, no globals consulted.
26
26
  */
27
27
  import type { CaptureMatch } from '../../../../_shared/index.js';
28
+ /** tree-sitter-typescript node types for function-like scopes that may
29
+ * carry a synthesized `this` binding. Kept in sync with the
30
+ * `@scope.function` patterns in `query.ts`. */
31
+ export declare const FUNCTION_NODE_TYPES: readonly ["method_definition", "method_signature", "abstract_method_signature", "arrow_function", "function_expression", "function_declaration", "generator_function_declaration", "generator_function", "function_signature"];
28
32
  export declare function emitTsScopeCaptures(sourceText: string, filePath: string, cachedTree?: unknown): readonly CaptureMatch[];
@@ -38,7 +38,7 @@ import { deriveDefaultExportHocName, isBlockedDefaultExportHoc, isDefaultExportH
38
38
  /** tree-sitter-typescript node types for function-like scopes that may
39
39
  * carry a synthesized `this` binding. Kept in sync with the
40
40
  * `@scope.function` patterns in `query.ts`. */
41
- const FUNCTION_NODE_TYPES = [
41
+ export const FUNCTION_NODE_TYPES = [
42
42
  'method_definition',
43
43
  'method_signature',
44
44
  'abstract_method_signature',
@@ -46,8 +46,47 @@ const FUNCTION_NODE_TYPES = [
46
46
  'function_expression',
47
47
  'function_declaration',
48
48
  'generator_function_declaration',
49
+ // The EXPRESSION form (`const g = function* () {}`). Both queries capture it
50
+ // as `@scope.function`, and both `this`-boundary lists already carry it, but
51
+ // this list did not — so callable-flow synthesis and the body-block filter
52
+ // treated a generator expression as a non-function.
53
+ //
54
+ // Measured: adding it changes no graph output today. A generator-expression
55
+ // binding still emits a `Const` node rather than a `Function` one, so the
56
+ // call never resolves either way — that label comes from the definition
57
+ // rules, not from here, and closing it is a separate change. This entry is
58
+ // list consistency, enforced by
59
+ // `test/unit/ts-js-function-node-type-lists.test.ts`.
60
+ 'generator_function',
49
61
  'function_signature',
50
62
  ];
63
+ /** Nodes whose `statement_block` child is their BODY, not a nested block.
64
+ * Such a block duplicates the enclosing Function scope — see the emit-side
65
+ * filter in `emitTsScopeCaptures`. */
66
+ const FUNCTION_BODY_OWNER_TYPES = new Set(FUNCTION_NODE_TYPES);
67
+ /** Direct-child node types that create a BINDING in their enclosing block.
68
+ * `variable_declaration` (`var`) is deliberately absent: it hoists past the
69
+ * block to the function, so a block containing only `var` binds nothing. */
70
+ const BLOCK_BINDING_CHILD_TYPES = new Set([
71
+ 'lexical_declaration',
72
+ 'class_declaration',
73
+ 'function_declaration',
74
+ 'generator_function_declaration',
75
+ ]);
76
+ /** True when `block` directly declares a name, i.e. it is a real environment
77
+ * record rather than punctuation. A block that binds nothing is transparent to
78
+ * every scope-chain walk — a lookup finds nothing in it and continues to the
79
+ * parent — so emitting a scope for it costs tree size and walk depth and buys
80
+ * exactly nothing. Only DIRECT children count: a declaration in a nested block
81
+ * belongs to that block, which gets its own scope by the same rule. */
82
+ const blockDeclaresBinding = (block) => {
83
+ for (let i = 0; i < block.namedChildCount; i++) {
84
+ const child = block.namedChild(i);
85
+ if (child !== null && BLOCK_BINDING_CHILD_TYPES.has(child.type))
86
+ return true;
87
+ }
88
+ return false;
89
+ };
51
90
  /** Declaration anchors that carry function-like arity metadata. */
52
91
  const FUNCTION_DECL_TAGS = ['@declaration.method', '@declaration.function'];
53
92
  /** Callsite anchors that should carry `@reference.arity` + param types. */
@@ -239,6 +278,24 @@ export function emitTsScopeCaptures(sourceText, filePath, cachedTree) {
239
278
  }
240
279
  continue;
241
280
  }
281
+ // A `statement_block` that IS a function body adds nothing: the enclosing
282
+ // Function scope already provides that environment record, so emitting one
283
+ // here just puts a redundant level inside EVERY function for every
284
+ // scope-chain walk to step through. Measured on a 762-file TypeScript
285
+ // corpus, keeping them cost ~6% of total analyze wall time; dropping them
286
+ // keeps the block scopes that matter (if/else/for/while/try/bare blocks,
287
+ // where `let`/`const` genuinely shadow) at no measurable cost.
288
+ //
289
+ // Semantically safe: nothing can be declared between a function and its
290
+ // own body, so a binding in either resolves identically.
291
+ if (grouped['@scope.block'] !== undefined) {
292
+ const blockNode = groupedNodes['@scope.block'];
293
+ const parentType = blockNode?.parent?.type;
294
+ if (parentType !== undefined && FUNCTION_BODY_OWNER_TYPES.has(parentType))
295
+ continue;
296
+ if (blockNode === undefined || !blockDeclaresBinding(blockNode))
297
+ continue;
298
+ }
242
299
  // Filter out `@reference.read.member` matches whose AST parent tells
243
300
  // us they are actually calls / writes / constructor invocations. The
244
301
  // tree-sitter pattern is context-free and matches every member_expression;
@@ -50,6 +50,7 @@
50
50
  * sitter init cost per file.
51
51
  */
52
52
  import Parser from 'tree-sitter';
53
+ export declare const TYPESCRIPT_SCOPE_QUERY: string;
53
54
  /**
54
55
  * Return the right tree-sitter parser for `filePath` (or the TS parser
55
56
  * when no path is given — the legacy callsite shape).
@@ -71,7 +71,7 @@ const TSX_GRAMMAR = TS.tsx;
71
71
  function isTsxFile(filePath) {
72
72
  return filePath.endsWith('.tsx');
73
73
  }
74
- const TYPESCRIPT_SCOPE_QUERY = `
74
+ export const TYPESCRIPT_SCOPE_QUERY = `
75
75
  ;; Scopes — module / namespace / class-likes / function-likes
76
76
  (program) @scope.module
77
77
 
@@ -87,14 +87,26 @@ const TYPESCRIPT_SCOPE_QUERY = `
87
87
  ;; class expressions omit it); ScopeExtractor tolerates missing names.
88
88
  (class) @scope.class
89
89
 
90
- (function_declaration) @scope.function
91
- (generator_function_declaration) @scope.function
92
- (function_signature) @scope.function
93
- (method_definition) @scope.function
94
- (method_signature) @scope.function
95
- (abstract_method_signature) @scope.function
90
+ ;; \`@receiver-owner.this\` marks a scope that BINDS its own \`this\` rather
91
+ ;; than inheriting one (#2701) — see \`Scope.ownsReceivers\`. Every function
92
+ ;; form except \`arrow_function\` carries it: ECMA-262 gives an arrow
93
+ ;; \`[[ThisMode]] = lexical\` (no \`this\` in its environment record, so the
94
+ ;; lookup passes through), while every other form binds \`this\` at call time.
95
+ ;; \`method_definition\` is marked too and is unaffected — it also carries a
96
+ ;; synthesized \`this\` typeBinding, which the walk consults first.
97
+ ;; The marker rides on the same node as \`@scope.function\`; it is outside the
98
+ ;; \`@scope.\` namespace so \`anchorCaptureFor\` cannot mistake it for the anchor.
99
+ (function_declaration) @scope.function @receiver-owner.this
100
+ (generator_function_declaration) @scope.function @receiver-owner.this
101
+ (function_signature) @scope.function @receiver-owner.this
102
+ (method_definition) @scope.function @receiver-owner.this
103
+ (method_signature) @scope.function @receiver-owner.this
104
+ (abstract_method_signature) @scope.function @receiver-owner.this
96
105
  (arrow_function) @scope.function
97
- (function_expression) @scope.function
106
+ (function_expression) @scope.function @receiver-owner.this
107
+ ;; \`function*(){}\` as an EXPRESSION. Absent from this list before #2701, so it
108
+ ;; was not a scope at all and \`this\` inside one read as the enclosing method's.
109
+ (generator_function) @scope.function @receiver-owner.this
98
110
 
99
111
  ;; Object literals (the { ... } value expression, NOT object_type or
100
112
  ;; object_pattern) get their own scope boundary. Without it, a
@@ -113,6 +125,16 @@ const TYPESCRIPT_SCOPE_QUERY = `
113
125
  ;; (#2551).
114
126
  (object) @scope.object
115
127
 
128
+ ;; Statement blocks are BINDING scopes (#2699). ECMAScript gives every block its
129
+ ;; own environment record, so \`let\`/\`const\`/\`class\`/\`function\` declared in
130
+ ;; sibling blocks of one function are DIFFERENT bindings — without this the
131
+ ;; resolver sees both as function-level and a call in one branch resolves to
132
+ ;; both. \`tsBindingScopeFor\` already implements the other half of the rule:
133
+ ;; \`var\` hoists past blocks to the enclosing Function/Module, \`let\`/\`const\`
134
+ ;; take the innermost scope, which is now the block.
135
+ (statement_block) @scope.block
136
+
137
+
116
138
  ;; Type aliases that contain an object_type are structurally class-like —
117
139
  ;; they define a shape with named members. Emit @scope.class so the
118
140
  ;; field-extractor's type-alias-with-object-type handling (in
@@ -57,3 +57,20 @@ import { type SyntaxNode } from '../../utils/ast-helpers.js';
57
57
  * of the scope function nodes the scope query emits.
58
58
  */
59
59
  export declare function synthesizeTsReceiverBinding(fnNode: SyntaxNode): CaptureMatch | null;
60
+ /**
61
+ * Nodes that REBIND `this`, so the walk for an enclosing type must stop at them.
62
+ *
63
+ * Without these the walk ran to the top of the file and happily synthesized a binding
64
+ * from a type that does not own the member. An object-literal method nested in a class
65
+ * bound `this` to the CLASS:
66
+ *
67
+ * class A { outer() { const o = { inner() { return this.x; } }; return o; } }
68
+ *
69
+ * `this` inside `o.inner` is `o`, never `A` — so every `this.…` in such a method
70
+ * resolved against the wrong type. Only the module-level object literal escaped, because
71
+ * there was no enclosing class to reach.
72
+ *
73
+ * An arrow is deliberately absent: it inherits `this` lexically, so the walk SHOULD pass
74
+ * through it (that is what makes a class-field arrow `m = () => this.x` resolve).
75
+ */
76
+ export declare const THIS_REBINDING_BOUNDARY_TYPES: ReadonlySet<string>;
@@ -140,9 +140,36 @@ function isStaticMember(memberNode) {
140
140
  }
141
141
  return false;
142
142
  }
143
+ /**
144
+ * Nodes that REBIND `this`, so the walk for an enclosing type must stop at them.
145
+ *
146
+ * Without these the walk ran to the top of the file and happily synthesized a binding
147
+ * from a type that does not own the member. An object-literal method nested in a class
148
+ * bound `this` to the CLASS:
149
+ *
150
+ * class A { outer() { const o = { inner() { return this.x; } }; return o; } }
151
+ *
152
+ * `this` inside `o.inner` is `o`, never `A` — so every `this.…` in such a method
153
+ * resolved against the wrong type. Only the module-level object literal escaped, because
154
+ * there was no enclosing class to reach.
155
+ *
156
+ * An arrow is deliberately absent: it inherits `this` lexically, so the walk SHOULD pass
157
+ * through it (that is what makes a class-field arrow `m = () => this.x` resolve).
158
+ */
159
+ export const THIS_REBINDING_BOUNDARY_TYPES = new Set([
160
+ 'object', // object literal — `this` is the literal, not any enclosing type
161
+ 'function_declaration',
162
+ 'function_expression',
163
+ 'generator_function',
164
+ 'generator_function_declaration',
165
+ ]);
143
166
  function findEnclosingType(node) {
144
167
  let cur = node.parent;
145
168
  while (cur !== null) {
169
+ // Boundary before the type check: a rebinding node between the member and a type
170
+ // means the type does not own this `this`.
171
+ if (THIS_REBINDING_BOUNDARY_TYPES.has(cur.type))
172
+ return null;
146
173
  if (TYPE_DECL_NODE_TYPES.has(cur.type))
147
174
  return cur;
148
175
  cur = cur.parent;
@@ -250,6 +250,15 @@ export const BUILT_INS = new Set([
250
250
  'toString',
251
251
  'valueOf',
252
252
  ]);
253
+ /**
254
+ * `this` is the only receiver keyword JavaScript and TypeScript bind, and it
255
+ * is bound by every function form except an arrow (#2701). The query files
256
+ * tag those forms with `@receiver-owner.this`; this hook just reads the tag,
257
+ * so the node-type list stays in the one place that already names grammar
258
+ * nodes. See `Scope.ownsReceivers` for what the marker does to the walk.
259
+ */
260
+ const TS_OWNED_RECEIVERS = new Set(['this']);
261
+ const tsScopeOwnsReceivers = (match) => match['@receiver-owner.this'] === undefined ? undefined : TS_OWNED_RECEIVERS;
253
262
  export const typescriptProvider = defineLanguage({
254
263
  id: SupportedLanguages.TypeScript,
255
264
  extensions: ['.ts', '.tsx'],
@@ -278,6 +287,7 @@ export const typescriptProvider = defineLanguage({
278
287
  ],
279
288
  treeSitterQueries: TYPESCRIPT_QUERIES,
280
289
  typeConfig: typescriptConfig,
290
+ scopeOwnsReceivers: tsScopeOwnsReceivers,
281
291
  exportChecker: tsExportChecker,
282
292
  importResolver: createImportResolver(typescriptImportConfig),
283
293
  callExtractor: createCallExtractor(typescriptCallConfig),
@@ -343,6 +353,7 @@ export const javascriptProvider = defineLanguage({
343
353
  ],
344
354
  treeSitterQueries: JAVASCRIPT_QUERIES,
345
355
  typeConfig: typescriptConfig,
356
+ scopeOwnsReceivers: tsScopeOwnsReceivers,
346
357
  exportChecker: tsExportChecker,
347
358
  importResolver: createImportResolver(javascriptImportConfig),
348
359
  callExtractor: createCallExtractor(javascriptCallConfig),
@@ -73,7 +73,7 @@ import type { LanguageProvider } from './language-provider.js';
73
73
  * Real callers pass a full `LanguageProvider` — structural typing makes it
74
74
  * a `ScopeExtractorHooks` for free.
75
75
  */
76
- export type ScopeExtractorHooks = Pick<LanguageProvider, 'resolveScopeKind' | 'bindingScopeFor' | 'interpretImport' | 'interpretTypeBinding' | 'classifyCallForm'>;
76
+ export type ScopeExtractorHooks = Pick<LanguageProvider, 'resolveScopeKind' | 'scopeOwnsReceivers' | 'bindingScopeFor' | 'interpretImport' | 'interpretTypeBinding' | 'classifyCallForm'>;
77
77
  /**
78
78
  * Drive the five extraction passes and return a `ParsedFile`.
79
79
  *