@zuvia-software-solutions/code-mapper 2.3.6 → 2.3.7

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.
@@ -764,20 +764,39 @@ async function batchResolveTsgo(tsgoService, extractedCalls, ctx, graph, repoPat
764
764
  }
765
765
  list.push(call);
766
766
  }
767
- // Pre-filter: skip free-form calls ONLY when the function name is unambiguous
768
- // in the symbol table. Heuristic resolves unique names perfectly.
769
- // Ambiguous names (multiple symbols with same name) need tsgo for disambiguation.
767
+ // Built-in receiver names that resolve to external types, not project code.
768
+ // tsgo always fails on these skip them to avoid wasted LSP round-trips.
769
+ const BUILTIN_RECEIVERS = new Set([
770
+ 'console', 'Math', 'JSON', 'Object', 'Array', 'String', 'Number', 'Boolean',
771
+ 'Date', 'RegExp', 'Error', 'Promise', 'Map', 'Set', 'WeakMap', 'WeakSet',
772
+ 'Buffer', 'process', 'globalThis', 'window', 'document', 'navigator',
773
+ 'setTimeout', 'setInterval', 'clearTimeout', 'clearInterval',
774
+ 'require', 'module', 'exports', '__dirname', '__filename',
775
+ 'fs', 'path', 'os', 'url', 'util', 'crypto', 'http', 'https', 'net',
776
+ 'child_process', 'stream', 'events', 'assert', 'zlib',
777
+ ]);
778
+ // Pre-filter calls where tsgo won't add value:
779
+ // A. Free-form calls with unambiguous name — heuristic resolves perfectly
780
+ // B. Member calls with known receiver type AND unambiguous method — heuristic handles
781
+ // C. Member calls on built-in receivers — tsgo always fails on these
770
782
  const tsgoEligible = [];
771
- let skippedHeuristic = 0;
783
+ let skippedUnambiguous = 0;
784
+ const skippedKnownType = 0;
785
+ let skippedBuiltin = 0;
772
786
  for (const call of eligible) {
787
+ // A. Free-form, unique name match
773
788
  if (call.callForm === 'free' || call.callForm === undefined) {
774
789
  const resolved = ctx.resolve(call.calledName, call.filePath);
775
- // Unique match — heuristic handles this at high confidence
776
790
  if (resolved && resolved.candidates.length === 1) {
777
- skippedHeuristic++;
791
+ skippedUnambiguous++;
778
792
  continue;
779
793
  }
780
794
  }
795
+ // B. Built-in receiver — tsgo resolves to node_modules/lib.d.ts, never project code
796
+ if (call.callForm === 'member' && call.receiverName && BUILTIN_RECEIVERS.has(call.receiverName)) {
797
+ skippedBuiltin++;
798
+ continue;
799
+ }
781
800
  tsgoEligible.push(call);
782
801
  }
783
802
  // Regroup filtered calls by file
@@ -793,7 +812,8 @@ async function batchResolveTsgo(tsgoService, extractedCalls, ctx, graph, repoPat
793
812
  let resolved = 0;
794
813
  let failed = 0;
795
814
  const t0 = Date.now();
796
- console.error(`Code Mapper: tsgo resolving ${tsgoEligible.length} calls across ${tsgoByFile.size} files (skipped ${skippedHeuristic} heuristic-resolvable)...`);
815
+ const skippedTotal = skippedUnambiguous + skippedKnownType + skippedBuiltin;
816
+ console.error(`Code Mapper: tsgo resolving ${tsgoEligible.length} calls across ${tsgoByFile.size} files (skipped ${skippedTotal}: ${skippedUnambiguous} unambiguous, ${skippedKnownType} known-type, ${skippedBuiltin} builtin)...`);
797
817
  let tsgoFilesProcessed = 0;
798
818
  const tsgoTotalFiles = tsgoByFile.size;
799
819
  for (const [filePath, calls] of tsgoByFile) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zuvia-software-solutions/code-mapper",
3
- "version": "2.3.6",
3
+ "version": "2.3.7",
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",