gitnexus 1.6.6-rc.58 → 1.6.6-rc.59

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.
@@ -153,12 +153,34 @@ export function populateCppDependentBases(parsedFiles) {
153
153
  }
154
154
  // Multiple classes share the same simple name — prefer the one
155
155
  // whose namespace matches the deriving class's namespace.
156
- // V1: exact dot-prefix match only. Cross-namespace inheritance
157
- // (e.g., `ns::outer::Derived` extending bare `Inner` defined in
158
- // `ns::outer::inner`) and inline-namespace cases are deferred to
159
- // V2; the conservative skip-on-ambiguity below avoids false
160
- // associations in those edge cases.
161
- const nsMatch = candidates.find((c) => c.nsPrefix === classEntry.nsPrefix);
156
+ // V2: filter by prefix-match capped at one level deeper, then
157
+ // accept only if exactly one candidate survives. This lets
158
+ // Derived<T> in ns::outer find Inner<T> in ns::outer::inner
159
+ // (or ns::v1 for inline-namespace variants) while rejecting
160
+ // sibling collisions (e.g. detail::Inner vs public_api::Inner).
161
+ //
162
+ // The one-segment cap limits walk depth: ns → ns.a ✓, ns → ns.a.b ✗.
163
+ // Global-scope deriving classes match any single-segment namespace.
164
+ //
165
+ // LIMITATION: True ISO behavior would use the base specifier's
166
+ // syntactic qualifier (available at captures.ts:611 as
167
+ // qualified_identifier scope) to navigate from the current scope,
168
+ // which would resolve `detail::Inner` vs `public_api::Inner`
169
+ // unambiguously. Threading the qualifier is tracked in #1815.
170
+ // Until then, sibling collisions correctly suppress.
171
+ const nsMatches = candidates.filter((c) => {
172
+ if (c.nsPrefix === classEntry.nsPrefix)
173
+ return true;
174
+ if (classEntry.nsPrefix === '') {
175
+ return c.nsPrefix !== '' && !c.nsPrefix.includes('.');
176
+ }
177
+ if (c.nsPrefix.startsWith(classEntry.nsPrefix + '.')) {
178
+ const suffix = c.nsPrefix.slice(classEntry.nsPrefix.length + 1);
179
+ return !suffix.includes('.');
180
+ }
181
+ return false;
182
+ });
183
+ const nsMatch = nsMatches.length === 1 ? nsMatches[0] : undefined;
162
184
  if (nsMatch !== undefined) {
163
185
  bases.add(nsMatch.nodeId);
164
186
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gitnexus",
3
- "version": "1.6.6-rc.58",
3
+ "version": "1.6.6-rc.59",
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",