@colbymchenry/codegraph-darwin-x64 1.0.0 → 1.1.0
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.
- package/lib/dist/bin/codegraph.js +258 -17
- package/lib/dist/bin/codegraph.js.map +1 -1
- package/lib/dist/bin/fatal-handler.d.ts +20 -0
- package/lib/dist/bin/fatal-handler.d.ts.map +1 -0
- package/lib/dist/bin/fatal-handler.js +118 -0
- package/lib/dist/bin/fatal-handler.js.map +1 -0
- package/lib/dist/db/index.d.ts +22 -1
- package/lib/dist/db/index.d.ts.map +1 -1
- package/lib/dist/db/index.js +46 -1
- package/lib/dist/db/index.js.map +1 -1
- package/lib/dist/db/queries.d.ts +14 -0
- package/lib/dist/db/queries.d.ts.map +1 -1
- package/lib/dist/db/queries.js +25 -0
- package/lib/dist/db/queries.js.map +1 -1
- package/lib/dist/directory.d.ts +58 -0
- package/lib/dist/directory.d.ts.map +1 -1
- package/lib/dist/directory.js +165 -0
- package/lib/dist/directory.js.map +1 -1
- package/lib/dist/extraction/grammars.d.ts +11 -3
- package/lib/dist/extraction/grammars.d.ts.map +1 -1
- package/lib/dist/extraction/grammars.js +14 -5
- package/lib/dist/extraction/grammars.js.map +1 -1
- package/lib/dist/extraction/index.d.ts.map +1 -1
- package/lib/dist/extraction/index.js +202 -32
- package/lib/dist/extraction/index.js.map +1 -1
- package/lib/dist/extraction/languages/c-cpp.d.ts.map +1 -1
- package/lib/dist/extraction/languages/c-cpp.js +47 -2
- package/lib/dist/extraction/languages/c-cpp.js.map +1 -1
- package/lib/dist/extraction/languages/csharp.d.ts.map +1 -1
- package/lib/dist/extraction/languages/csharp.js +20 -0
- package/lib/dist/extraction/languages/csharp.js.map +1 -1
- package/lib/dist/extraction/languages/dart.d.ts.map +1 -1
- package/lib/dist/extraction/languages/dart.js +22 -0
- package/lib/dist/extraction/languages/dart.js.map +1 -1
- package/lib/dist/extraction/languages/java.d.ts.map +1 -1
- package/lib/dist/extraction/languages/java.js +213 -9
- package/lib/dist/extraction/languages/java.js.map +1 -1
- package/lib/dist/extraction/languages/kotlin.d.ts.map +1 -1
- package/lib/dist/extraction/languages/kotlin.js +51 -0
- package/lib/dist/extraction/languages/kotlin.js.map +1 -1
- package/lib/dist/extraction/languages/scala.d.ts.map +1 -1
- package/lib/dist/extraction/languages/scala.js +19 -9
- package/lib/dist/extraction/languages/scala.js.map +1 -1
- package/lib/dist/extraction/parse-worker.js +4 -1
- package/lib/dist/extraction/parse-worker.js.map +1 -1
- package/lib/dist/extraction/tree-sitter-types.d.ts +13 -0
- package/lib/dist/extraction/tree-sitter-types.d.ts.map +1 -1
- package/lib/dist/extraction/tree-sitter.d.ts +119 -0
- package/lib/dist/extraction/tree-sitter.d.ts.map +1 -1
- package/lib/dist/extraction/tree-sitter.js +890 -11
- package/lib/dist/extraction/tree-sitter.js.map +1 -1
- package/lib/dist/index.d.ts +33 -0
- package/lib/dist/index.d.ts.map +1 -1
- package/lib/dist/index.js +68 -7
- package/lib/dist/index.js.map +1 -1
- package/lib/dist/installer/index.d.ts.map +1 -1
- package/lib/dist/installer/index.js +33 -56
- package/lib/dist/installer/index.js.map +1 -1
- package/lib/dist/installer/instructions-template.d.ts +3 -3
- package/lib/dist/installer/instructions-template.d.ts.map +1 -1
- package/lib/dist/installer/instructions-template.js +4 -4
- package/lib/dist/installer/targets/claude.d.ts +18 -12
- package/lib/dist/installer/targets/claude.d.ts.map +1 -1
- package/lib/dist/installer/targets/claude.js +78 -6
- package/lib/dist/installer/targets/claude.js.map +1 -1
- package/lib/dist/installer/targets/shared.d.ts +12 -2
- package/lib/dist/installer/targets/shared.d.ts.map +1 -1
- package/lib/dist/installer/targets/shared.js +13 -12
- package/lib/dist/installer/targets/shared.js.map +1 -1
- package/lib/dist/installer/targets/types.d.ts +7 -0
- package/lib/dist/installer/targets/types.d.ts.map +1 -1
- package/lib/dist/mcp/daemon-manager.d.ts +42 -0
- package/lib/dist/mcp/daemon-manager.d.ts.map +1 -0
- package/lib/dist/mcp/daemon-manager.js +129 -0
- package/lib/dist/mcp/daemon-manager.js.map +1 -0
- package/lib/dist/mcp/daemon-registry.d.ts +47 -0
- package/lib/dist/mcp/daemon-registry.d.ts.map +1 -0
- package/lib/dist/mcp/daemon-registry.js +229 -0
- package/lib/dist/mcp/daemon-registry.js.map +1 -0
- package/lib/dist/mcp/daemon.d.ts.map +1 -1
- package/lib/dist/mcp/daemon.js +5 -0
- package/lib/dist/mcp/daemon.js.map +1 -1
- package/lib/dist/mcp/engine.d.ts.map +1 -1
- package/lib/dist/mcp/engine.js +8 -0
- package/lib/dist/mcp/engine.js.map +1 -1
- package/lib/dist/mcp/index.d.ts +1 -0
- package/lib/dist/mcp/index.d.ts.map +1 -1
- package/lib/dist/mcp/index.js +13 -0
- package/lib/dist/mcp/index.js.map +1 -1
- package/lib/dist/mcp/liveness-watchdog.d.ts +18 -0
- package/lib/dist/mcp/liveness-watchdog.d.ts.map +1 -0
- package/lib/dist/mcp/liveness-watchdog.js +207 -0
- package/lib/dist/mcp/liveness-watchdog.js.map +1 -0
- package/lib/dist/mcp/server-instructions.d.ts +18 -14
- package/lib/dist/mcp/server-instructions.d.ts.map +1 -1
- package/lib/dist/mcp/server-instructions.js +57 -52
- package/lib/dist/mcp/server-instructions.js.map +1 -1
- package/lib/dist/mcp/session.d.ts.map +1 -1
- package/lib/dist/mcp/session.js +23 -18
- package/lib/dist/mcp/session.js.map +1 -1
- package/lib/dist/mcp/tools.d.ts +51 -1
- package/lib/dist/mcp/tools.d.ts.map +1 -1
- package/lib/dist/mcp/tools.js +585 -151
- package/lib/dist/mcp/tools.js.map +1 -1
- package/lib/dist/project-config.d.ts +19 -0
- package/lib/dist/project-config.d.ts.map +1 -0
- package/lib/dist/project-config.js +180 -0
- package/lib/dist/project-config.js.map +1 -0
- package/lib/dist/reasoning/config.d.ts +45 -0
- package/lib/dist/reasoning/config.d.ts.map +1 -0
- package/lib/dist/reasoning/config.js +171 -0
- package/lib/dist/reasoning/config.js.map +1 -0
- package/lib/dist/reasoning/credentials.d.ts +5 -0
- package/lib/dist/reasoning/credentials.d.ts.map +1 -0
- package/lib/dist/reasoning/credentials.js +83 -0
- package/lib/dist/reasoning/credentials.js.map +1 -0
- package/lib/dist/reasoning/login.d.ts +21 -0
- package/lib/dist/reasoning/login.d.ts.map +1 -0
- package/lib/dist/reasoning/login.js +85 -0
- package/lib/dist/reasoning/login.js.map +1 -0
- package/lib/dist/reasoning/reasoner.d.ts +43 -0
- package/lib/dist/reasoning/reasoner.d.ts.map +1 -0
- package/lib/dist/reasoning/reasoner.js +308 -0
- package/lib/dist/reasoning/reasoner.js.map +1 -0
- package/lib/dist/resolution/c-fnptr-synthesizer.d.ts +33 -0
- package/lib/dist/resolution/c-fnptr-synthesizer.d.ts.map +1 -0
- package/lib/dist/resolution/c-fnptr-synthesizer.js +352 -0
- package/lib/dist/resolution/c-fnptr-synthesizer.js.map +1 -0
- package/lib/dist/resolution/callback-synthesizer.d.ts +6 -1
- package/lib/dist/resolution/callback-synthesizer.d.ts.map +1 -1
- package/lib/dist/resolution/callback-synthesizer.js +1109 -1
- package/lib/dist/resolution/callback-synthesizer.js.map +1 -1
- package/lib/dist/resolution/frameworks/goframe.d.ts +41 -0
- package/lib/dist/resolution/frameworks/goframe.d.ts.map +1 -0
- package/lib/dist/resolution/frameworks/goframe.js +112 -0
- package/lib/dist/resolution/frameworks/goframe.js.map +1 -0
- package/lib/dist/resolution/frameworks/index.d.ts +1 -0
- package/lib/dist/resolution/frameworks/index.d.ts.map +1 -1
- package/lib/dist/resolution/frameworks/index.js +5 -1
- package/lib/dist/resolution/frameworks/index.js.map +1 -1
- package/lib/dist/resolution/frameworks/react.d.ts.map +1 -1
- package/lib/dist/resolution/frameworks/react.js +17 -60
- package/lib/dist/resolution/frameworks/react.js.map +1 -1
- package/lib/dist/resolution/goframe-synthesizer.d.ts +28 -0
- package/lib/dist/resolution/goframe-synthesizer.d.ts.map +1 -0
- package/lib/dist/resolution/goframe-synthesizer.js +158 -0
- package/lib/dist/resolution/goframe-synthesizer.js.map +1 -0
- package/lib/dist/resolution/import-resolver.d.ts.map +1 -1
- package/lib/dist/resolution/import-resolver.js +56 -0
- package/lib/dist/resolution/import-resolver.js.map +1 -1
- package/lib/dist/resolution/name-matcher.d.ts.map +1 -1
- package/lib/dist/resolution/name-matcher.js +48 -8
- package/lib/dist/resolution/name-matcher.js.map +1 -1
- package/lib/dist/resolution/strip-comments.d.ts +1 -1
- package/lib/dist/resolution/strip-comments.d.ts.map +1 -1
- package/lib/dist/resolution/strip-comments.js +2 -0
- package/lib/dist/resolution/strip-comments.js.map +1 -1
- package/lib/dist/sync/watcher.d.ts +68 -1
- package/lib/dist/sync/watcher.d.ts.map +1 -1
- package/lib/dist/sync/watcher.js +212 -14
- package/lib/dist/sync/watcher.js.map +1 -1
- package/lib/dist/telemetry/index.d.ts +0 -3
- package/lib/dist/telemetry/index.d.ts.map +1 -1
- package/lib/dist/telemetry/index.js +4 -7
- package/lib/dist/telemetry/index.js.map +1 -1
- package/lib/dist/upgrade/index.d.ts.map +1 -1
- package/lib/dist/upgrade/index.js +40 -4
- package/lib/dist/upgrade/index.js.map +1 -1
- package/lib/dist/utils.d.ts +14 -1
- package/lib/dist/utils.d.ts.map +1 -1
- package/lib/dist/utils.js +20 -2
- package/lib/dist/utils.js.map +1 -1
- package/lib/node_modules/.package-lock.json +1 -1
- package/lib/package.json +2 -2
- package/package.json +1 -1
|
@@ -16,8 +16,12 @@ export declare const EXTENSION_MAP: Record<string, Language>;
|
|
|
16
16
|
* Whether a file is one CodeGraph can parse, based purely on its extension.
|
|
17
17
|
* This is the single source of truth for "should we index this file" — derived
|
|
18
18
|
* from EXTENSION_MAP so parser support and indexing selection never drift.
|
|
19
|
+
*
|
|
20
|
+
* `overrides` is the project's validated custom extension → language map (from
|
|
21
|
+
* `codegraph.json`); when present its extensions count as indexable in addition
|
|
22
|
+
* to the built-ins. Omitting it is byte-identical to the zero-config behavior.
|
|
19
23
|
*/
|
|
20
|
-
export declare function isSourceFile(filePath: string): boolean;
|
|
24
|
+
export declare function isSourceFile(filePath: string, overrides?: Record<string, Language>): boolean;
|
|
21
25
|
/**
|
|
22
26
|
* Shopify OS 2.0 JSON template (`templates/*.json`) or section group
|
|
23
27
|
* (`sections/*.json`) — these reference sections by `"type"`, so the Liquid
|
|
@@ -57,9 +61,13 @@ export declare function isGrammarsInitialized(): boolean;
|
|
|
57
61
|
*/
|
|
58
62
|
export declare function getParser(language: Language): Parser | null;
|
|
59
63
|
/**
|
|
60
|
-
* Detect language from file extension
|
|
64
|
+
* Detect language from file extension.
|
|
65
|
+
*
|
|
66
|
+
* `overrides` is the project's validated custom extension → language map (from
|
|
67
|
+
* `codegraph.json`); when present its mappings take precedence over the built-in
|
|
68
|
+
* `EXTENSION_MAP`. Omitting it is byte-identical to the zero-config behavior.
|
|
61
69
|
*/
|
|
62
|
-
export declare function detectLanguage(filePath: string, source?: string): Language;
|
|
70
|
+
export declare function detectLanguage(filePath: string, source?: string, overrides?: Record<string, Language>): Language;
|
|
63
71
|
/**
|
|
64
72
|
* Check if a language is supported (has a grammar defined).
|
|
65
73
|
* Returns true if the grammar exists, even if not yet loaded.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"grammars.d.ts","sourceRoot":"","sources":["../../src/extraction/grammars.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAAE,MAAM,EAA4B,MAAM,iBAAiB,CAAC;AACnE,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAEpC,MAAM,MAAM,eAAe,GAAG,OAAO,CAAC,QAAQ,EAAE,QAAQ,GAAG,KAAK,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,KAAK,GAAG,YAAY,GAAG,SAAS,CAAC,CAAC;AA+BtJ;;GAEG;AACH,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CA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C,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAiBhH;AAmBD;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAY/D;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAK3D;AAED;;;;;;;;GAQG;AACH,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAEnE;AAED;;GAEG;AACH,wBAAgB,qBAAqB,IAAI,QAAQ,EAAE,CAElD;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,QAAQ,EAAE,QAAQ,GAAG,IAAI,CAMpD;AAED;;GAEG;AACH,wBAAgB,gBAAgB,IAAI,IAAI,CAQvC;AAED;;GAEG;AACH,wBAAgB,2BAA2B,IAAI,OAAO,CAAC,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,CAM/E;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,QAAQ,GAAG,MAAM,CAoCjE"}
|
|
@@ -167,8 +167,12 @@ exports.EXTENSION_MAP = {
|
|
|
167
167
|
* Whether a file is one CodeGraph can parse, based purely on its extension.
|
|
168
168
|
* This is the single source of truth for "should we index this file" — derived
|
|
169
169
|
* from EXTENSION_MAP so parser support and indexing selection never drift.
|
|
170
|
+
*
|
|
171
|
+
* `overrides` is the project's validated custom extension → language map (from
|
|
172
|
+
* `codegraph.json`); when present its extensions count as indexable in addition
|
|
173
|
+
* to the built-ins. Omitting it is byte-identical to the zero-config behavior.
|
|
170
174
|
*/
|
|
171
|
-
function isSourceFile(filePath) {
|
|
175
|
+
function isSourceFile(filePath, overrides) {
|
|
172
176
|
if (isPlayRoutesFile(filePath))
|
|
173
177
|
return true; // Play `conf/routes` is extensionless
|
|
174
178
|
if (isShopifyLiquidJson(filePath))
|
|
@@ -176,7 +180,8 @@ function isSourceFile(filePath) {
|
|
|
176
180
|
const dot = filePath.lastIndexOf('.');
|
|
177
181
|
if (dot < 0)
|
|
178
182
|
return false;
|
|
179
|
-
|
|
183
|
+
const ext = filePath.slice(dot).toLowerCase();
|
|
184
|
+
return ext in exports.EXTENSION_MAP || (!!overrides && ext in overrides);
|
|
180
185
|
}
|
|
181
186
|
/**
|
|
182
187
|
* Shopify OS 2.0 JSON template (`templates/*.json`) or section group
|
|
@@ -295,9 +300,13 @@ function getParser(language) {
|
|
|
295
300
|
return parser;
|
|
296
301
|
}
|
|
297
302
|
/**
|
|
298
|
-
* Detect language from file extension
|
|
303
|
+
* Detect language from file extension.
|
|
304
|
+
*
|
|
305
|
+
* `overrides` is the project's validated custom extension → language map (from
|
|
306
|
+
* `codegraph.json`); when present its mappings take precedence over the built-in
|
|
307
|
+
* `EXTENSION_MAP`. Omitting it is byte-identical to the zero-config behavior.
|
|
299
308
|
*/
|
|
300
|
-
function detectLanguage(filePath, source) {
|
|
309
|
+
function detectLanguage(filePath, source, overrides) {
|
|
301
310
|
// Play `conf/routes` has no grammar — route through the no-symbol path; the
|
|
302
311
|
// Play framework resolver extracts route nodes from it.
|
|
303
312
|
if (isPlayRoutesFile(filePath))
|
|
@@ -307,7 +316,7 @@ function detectLanguage(filePath, source) {
|
|
|
307
316
|
// links each section `"type"` to its `sections/<type>.liquid`).
|
|
308
317
|
if (isShopifyLiquidJson(filePath))
|
|
309
318
|
return 'liquid';
|
|
310
|
-
const lang = exports.EXTENSION_MAP[ext] || 'unknown';
|
|
319
|
+
const lang = (overrides && overrides[ext]) || exports.EXTENSION_MAP[ext] || 'unknown';
|
|
311
320
|
// .h files could be C, C++, or Objective-C — check source content
|
|
312
321
|
if (lang === 'c' && ext === '.h' && source) {
|
|
313
322
|
if (looksLikeCpp(source))
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"grammars.js","sourceRoot":"","sources":["../../src/extraction/grammars.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"grammars.js","sourceRoot":"","sources":["../../src/extraction/grammars.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0HH,oCAOC;AAOD,kDAIC;AAOD,4CAMC;AAgBD,oCAMC;AAOD,4DA8CC;AAMD,0CAGC;AAKD,sDAEC;AAMD,8BAcC;AASD,wCAiBC;AAuBD,kDAYC;AAKD,0CAKC;AAWD,0DAEC;AAKD,sDAEC;AASD,kCAMC;AAKD,4CAQC;AAKD,kEAMC;AAKD,wDAoCC;AAjbD,2CAA6B;AAC7B,qDAAmE;AAKnE;;;GAGG;AACH,MAAM,kBAAkB,GAAoC;IAC1D,UAAU,EAAE,6BAA6B;IACzC,GAAG,EAAE,sBAAsB;IAC3B,UAAU,EAAE,6BAA6B;IACzC,GAAG,EAAE,6BAA6B;IAClC,MAAM,EAAE,yBAAyB;IACjC,EAAE,EAAE,qBAAqB;IACzB,IAAI,EAAE,uBAAuB;IAC7B,IAAI,EAAE,uBAAuB;IAC7B,CAAC,EAAE,oBAAoB;IACvB,GAAG,EAAE,sBAAsB;IAC3B,MAAM,EAAE,0BAA0B;IAClC,GAAG,EAAE,sBAAsB;IAC3B,IAAI,EAAE,uBAAuB;IAC7B,KAAK,EAAE,wBAAwB;IAC/B,MAAM,EAAE,yBAAyB;IACjC,IAAI,EAAE,uBAAuB;IAC7B,MAAM,EAAE,yBAAyB;IACjC,KAAK,EAAE,wBAAwB;IAC/B,GAAG,EAAE,sBAAsB;IAC3B,CAAC,EAAE,oBAAoB;IACvB,IAAI,EAAE,uBAAuB;IAC7B,IAAI,EAAE,uBAAuB;CAC9B,CAAC;AAEF;;GAEG;AACU,QAAA,aAAa,GAA6B;IACrD,KAAK,EAAE,YAAY;IACnB,MAAM,EAAE,K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;;;OAIG;IACH,OAAO,CAAC,wBAAwB;IAQhC;;OAEG;IACG,QAAQ,CACZ,UAAU,CAAC,EAAE,CAAC,QAAQ,EAAE,aAAa,KAAK,IAAI,EAC9C,MAAM,CAAC,EAAE,WAAW,EACpB,OAAO,CAAC,EAAE,OAAO,GAChB,OAAO,CAAC,WAAW,CAAC;IA2fvB;;OAEG;IACG,UAAU,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,WAAW,CAAC;IA4C3D;;OAEG;IACG,SAAS,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAwChE;;;OAGG;IACG,oBAAoB,CACxB,YAAY,EAAE,MAAM,EACpB,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,EAAE,CAAC,KAAK,GACd,OAAO,CAAC,gBAAgB,CAAC;IA0D5B;;OAEG;IACH,OAAO,CAAC,qBAAqB;IAoH7B;;;;;;;OAOG;IACG,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC,QAAQ,EAAE,aAAa,KAAK,IAAI,GAAG,OAAO,CAAC,UAAU,CAAC;IA0I/E;;;OAGG;IACH,eAAe,IAAI;QAAE,KAAK,EAAE,MAAM,EAAE,CAAC;QAAC,QAAQ,EAAE,MAAM,EAAE,CAAC;QAAC,OAAO,EAAE,MAAM,EAAE,CAAA;KAAE;CAwF9E;AAGD,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,mBAAmB,EAAE,eAAe,EAAE,qBAAqB,EAAE,YAAY,EAAE,wBAAwB,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -55,6 +55,7 @@ const crypto = __importStar(require("crypto"));
|
|
|
55
55
|
const child_process_1 = require("child_process");
|
|
56
56
|
const tree_sitter_1 = require("./tree-sitter");
|
|
57
57
|
const grammars_1 = require("./grammars");
|
|
58
|
+
const project_config_1 = require("../project-config");
|
|
58
59
|
const directory_1 = require("../directory");
|
|
59
60
|
const errors_1 = require("../errors");
|
|
60
61
|
const utils_1 = require("../utils");
|
|
@@ -65,6 +66,17 @@ const frameworks_1 = require("../resolution/frameworks");
|
|
|
65
66
|
* File reads are I/O-bound; batching overlaps I/O wait with CPU parse work.
|
|
66
67
|
*/
|
|
67
68
|
const FILE_IO_BATCH_SIZE = 10;
|
|
69
|
+
/**
|
|
70
|
+
* How many files the `sync()` reconcile processes between cooperative yields to
|
|
71
|
+
* the event loop. The reconcile runs two O(files) loops of synchronous `fs`
|
|
72
|
+
* calls (existsSync for removals, statSync for adds/mods); on a very large repo
|
|
73
|
+
* (~100k files) an un-yielded run wedges the main thread for minutes, which both
|
|
74
|
+
* trips the liveness watchdog (it SIGKILLs a process whose loop stops turning)
|
|
75
|
+
* and blocks the first MCP tool call behind the catch-up gate (issue #905).
|
|
76
|
+
* Yielding every N files keeps the socket, the watchdog heartbeat, and any
|
|
77
|
+
* concurrent read query responsive while the reconcile runs.
|
|
78
|
+
*/
|
|
79
|
+
const SYNC_RECONCILE_YIELD_INTERVAL = 1000;
|
|
68
80
|
// PARSER_RESET_INTERVAL moved to parse-worker.ts (runs in worker thread)
|
|
69
81
|
/**
|
|
70
82
|
* Maximum time (ms) to wait for a single file to parse in the worker thread.
|
|
@@ -240,6 +252,20 @@ function buildDefaultIgnore(rootDir) {
|
|
|
240
252
|
function defaultsOnlyIgnore() {
|
|
241
253
|
return (0, ignore_1.default)().add(DEFAULT_IGNORE_PATTERNS);
|
|
242
254
|
}
|
|
255
|
+
/**
|
|
256
|
+
* `git ls-files --directory` collapses a wholly-untracked/ignored directory into
|
|
257
|
+
* one entry — and when the command's own cwd is such a directory (the indexed
|
|
258
|
+
* root is itself a git-ignored subdir of an enclosing repo), git emits the
|
|
259
|
+
* literal `./` meaning "this entire directory". That sentinel is not a real
|
|
260
|
+
* nested path: feeding it to the `ignore` matcher throws ("path should be a
|
|
261
|
+
* `path.relative()`d string, but got "./""), which used to abort `buildScopeIgnore`
|
|
262
|
+
* and so break the MCP daemon's watcher/auto-sync on connect; and joining it back
|
|
263
|
+
* onto `repoDir` would just re-point at the cwd. Drop it wherever we consume
|
|
264
|
+
* `--directory` output. (#936)
|
|
265
|
+
*/
|
|
266
|
+
function isWholeCwdEntry(entry) {
|
|
267
|
+
return entry === './' || entry === '.' || entry === '';
|
|
268
|
+
}
|
|
243
269
|
/**
|
|
244
270
|
* List the gitignored DIRECTORIES of a repo (collapsed, trailing-slash form),
|
|
245
271
|
* relative to `repoDir`. These are invisible to every other `git ls-files` /
|
|
@@ -250,7 +276,7 @@ function defaultsOnlyIgnore() {
|
|
|
250
276
|
function listIgnoredDirs(repoDir) {
|
|
251
277
|
try {
|
|
252
278
|
const out = (0, child_process_1.execFileSync)('git', ['ls-files', '-z', '-o', '-i', '--exclude-standard', '--directory'], { cwd: repoDir, encoding: 'utf-8', timeout: 30000, maxBuffer: 50 * 1024 * 1024, stdio: ['pipe', 'pipe', 'pipe'], windowsHide: true });
|
|
253
|
-
return out.split('\0').filter((e) => e.endsWith('/'));
|
|
279
|
+
return out.split('\0').filter((e) => e.endsWith('/') && !isWholeCwdEntry(e));
|
|
254
280
|
}
|
|
255
281
|
catch {
|
|
256
282
|
return [];
|
|
@@ -260,6 +286,48 @@ function listIgnoredDirs(repoDir) {
|
|
|
260
286
|
const EMBEDDED_REPO_SEARCH_DEPTH = 4;
|
|
261
287
|
/** Max directories examined per search — a huge ignored data dir must never stall a scan/sync. */
|
|
262
288
|
const EMBEDDED_REPO_SEARCH_ENTRIES = 2000;
|
|
289
|
+
/**
|
|
290
|
+
* Classify a directory's `.git` entry for embedded-repo discovery.
|
|
291
|
+
*
|
|
292
|
+
* - A `.git` **directory** is an embedded clone — distinct first-party code a
|
|
293
|
+
* super-repo merely hides from git; index it (#193, #514).
|
|
294
|
+
* - A `.git` **file** is a pointer (`gitdir: …`). A git **worktree** points into
|
|
295
|
+
* the host repo's own `.git/worktrees/<name>`, so it is a second working view
|
|
296
|
+
* of a repo CodeGraph already indexes — indexing it just duplicates the whole
|
|
297
|
+
* graph N times; skip it (#848). A **submodule worktree** points into
|
|
298
|
+
* `.git/modules/<module>/worktrees/<name>` — same duplication, so skip it too
|
|
299
|
+
* (#945). A **submodule** checkout points into `.git/modules/<module>` (no
|
|
300
|
+
* `worktrees/` segment) and is distinct code, so index it as before.
|
|
301
|
+
*
|
|
302
|
+
* Returns `'none'` when there is no `.git` entry here.
|
|
303
|
+
*/
|
|
304
|
+
function classifyGitDir(absDir) {
|
|
305
|
+
let st;
|
|
306
|
+
try {
|
|
307
|
+
st = fs.statSync(path.join(absDir, '.git'));
|
|
308
|
+
}
|
|
309
|
+
catch {
|
|
310
|
+
return 'none';
|
|
311
|
+
}
|
|
312
|
+
if (st.isDirectory())
|
|
313
|
+
return 'embedded';
|
|
314
|
+
if (!st.isFile())
|
|
315
|
+
return 'none';
|
|
316
|
+
try {
|
|
317
|
+
const gitdir = fs.readFileSync(path.join(absDir, '.git'), 'utf8').match(/^gitdir:\s*(.+)$/m)?.[1]?.trim();
|
|
318
|
+
// A worktree's gitdir lives under some repo's `.git/worktrees/<name>` —
|
|
319
|
+
// either the top-level repo's (`.git/worktrees/`) or, for a worktree of a
|
|
320
|
+
// submodule, that submodule's gitdir (`.git/modules/<module>/worktrees/`).
|
|
321
|
+
// The optional `modules/<module>` segment covers the submodule case (#945).
|
|
322
|
+
// Match both separators so a Windows-style pointer is recognized too.
|
|
323
|
+
if (gitdir && /(^|[\\/])\.git[\\/](modules[\\/][^\\/]+[\\/])?worktrees[\\/]/.test(gitdir))
|
|
324
|
+
return 'worktree';
|
|
325
|
+
}
|
|
326
|
+
catch {
|
|
327
|
+
// Unreadable `.git` pointer — fall back to the prior "index it" behavior.
|
|
328
|
+
}
|
|
329
|
+
return 'embedded';
|
|
330
|
+
}
|
|
263
331
|
/**
|
|
264
332
|
* Find git repositories nested under `absDir` (inclusive), shallow bounded BFS.
|
|
265
333
|
* Stops descending at each repo root found — contents belong to that repo's own
|
|
@@ -280,7 +348,11 @@ function findNestedGitRepos(absDir, relPrefix) {
|
|
|
280
348
|
(0, errors_1.logDebug)('Embedded-repo search entry cap hit — deeper repos (if any) not discovered', { under: relPrefix });
|
|
281
349
|
break;
|
|
282
350
|
}
|
|
283
|
-
|
|
351
|
+
const cls = classifyGitDir(abs);
|
|
352
|
+
if (cls === 'worktree') {
|
|
353
|
+
continue; // a git worktree duplicates an already-indexed repo (#848) — skip
|
|
354
|
+
}
|
|
355
|
+
if (cls === 'embedded') {
|
|
284
356
|
found.push(rel);
|
|
285
357
|
continue; // its own git handles everything below
|
|
286
358
|
}
|
|
@@ -375,7 +447,7 @@ function discoverEmbeddedRepoRoots(rootDir) {
|
|
|
375
447
|
try {
|
|
376
448
|
const o = (0, child_process_1.execFileSync)('git', ['ls-files', '-z', '-o', '--exclude-standard', '--directory'], { cwd: repoAbs, encoding: 'utf-8', timeout: 30000, maxBuffer: 50 * 1024 * 1024, stdio: ['pipe', 'pipe', 'pipe'], windowsHide: true });
|
|
377
449
|
for (const e of o.split('\0')) {
|
|
378
|
-
if (e.endsWith('/') && !defaults.ignores(e)) {
|
|
450
|
+
if (e.endsWith('/') && !isWholeCwdEntry(e) && !defaults.ignores(e)) {
|
|
379
451
|
candidates.push(...findNestedGitRepos(path.join(repoAbs, e), e));
|
|
380
452
|
}
|
|
381
453
|
}
|
|
@@ -452,7 +524,9 @@ function collectGitFiles(repoDir, prefix, files, embeddedRoots) {
|
|
|
452
524
|
// descend into default-ignored locations — an embedded repo inside
|
|
453
525
|
// node_modules is an npm git-dependency, not project code.
|
|
454
526
|
const childDir = path.join(repoDir, rel);
|
|
455
|
-
|
|
527
|
+
// A git worktree surfaces here as an opaque untracked dir too — skip it,
|
|
528
|
+
// it's a duplicate working view of an already-indexed repo (#848).
|
|
529
|
+
if (classifyGitDir(childDir) === 'embedded' && !defaultsOnlyIgnore().ignores(rel)) {
|
|
456
530
|
embeddedRoots?.add((0, utils_1.normalizePath)(prefix + rel));
|
|
457
531
|
collectGitFiles(childDir, prefix + rel, files, embeddedRoots);
|
|
458
532
|
}
|
|
@@ -522,15 +596,29 @@ function getGitVisibleFiles(rootDir) {
|
|
|
522
596
|
function getGitChangedFiles(rootDir) {
|
|
523
597
|
try {
|
|
524
598
|
const changes = { modified: [], added: [], deleted: [] };
|
|
525
|
-
|
|
599
|
+
// Custom extension → language overrides from the project's codegraph.json,
|
|
600
|
+
// so change detection sees the same custom-extension files the full index does.
|
|
601
|
+
const overrides = (0, project_config_1.loadExtensionOverrides)(rootDir);
|
|
602
|
+
collectGitStatus(rootDir, '', changes, overrides);
|
|
526
603
|
return changes;
|
|
527
604
|
}
|
|
528
605
|
catch {
|
|
529
606
|
return null;
|
|
530
607
|
}
|
|
531
608
|
}
|
|
532
|
-
function collectGitStatus(repoDir, prefix, out) {
|
|
609
|
+
function collectGitStatus(repoDir, prefix, out, overrides) {
|
|
533
610
|
const output = (0, child_process_1.execFileSync)('git', ['status', '--porcelain', '--no-renames'], { cwd: repoDir, encoding: 'utf-8', timeout: 10000, maxBuffer: 50 * 1024 * 1024, stdio: ['pipe', 'pipe', 'pipe'], windowsHide: true });
|
|
611
|
+
// This repo's own ignore rules — built-in defaults (#407) plus its .gitignore.
|
|
612
|
+
// Change detection must exclude the SAME files the full index does, but git
|
|
613
|
+
// status hides neither: it ignores nothing for *tracked* paths, and the
|
|
614
|
+
// built-in defaults aren't gitignore at all. Without this filter a committed
|
|
615
|
+
// vendor/ dir, or a tracked file under a .gitignored dir, surfaces here as a
|
|
616
|
+
// change — so `codegraph status` (which reads getChangedFiles) reports a
|
|
617
|
+
// pending edit the full index never tracks and `sync` never clears. Matching
|
|
618
|
+
// repo-relative `rel` at each recursion level mirrors getGitVisibleFiles'
|
|
619
|
+
// ScopeIgnore: every embedded repo is judged by ITS OWN rules, never the
|
|
620
|
+
// parent's. (#766)
|
|
621
|
+
const ig = buildDefaultIgnore(repoDir);
|
|
534
622
|
const untrackedDirs = [];
|
|
535
623
|
for (const line of output.split('\n')) {
|
|
536
624
|
if (line.length < 4)
|
|
@@ -544,15 +632,22 @@ function collectGitStatus(repoDir, prefix, out) {
|
|
|
544
632
|
continue;
|
|
545
633
|
}
|
|
546
634
|
const filePath = (0, utils_1.normalizePath)(prefix + rel);
|
|
547
|
-
|
|
548
|
-
|
|
635
|
+
if (!(0, grammars_1.isSourceFile)(filePath, overrides))
|
|
636
|
+
continue;
|
|
637
|
+
if (statusCode.includes('D')) {
|
|
638
|
+
// Deletions stay unfiltered: getChangedFiles acts on one only when the
|
|
639
|
+
// path is already tracked in the DB, where removal is always correct — and
|
|
640
|
+
// that lets a newly-excluded dir's stale rows clean themselves up. (#766)
|
|
641
|
+
out.deleted.push(filePath);
|
|
642
|
+
continue;
|
|
643
|
+
}
|
|
644
|
+
// Added (`??`) / modified files inside an excluded dir must not enter the
|
|
645
|
+
// index — match against the repo-relative path, same as the full scan. (#766)
|
|
646
|
+
if (ig.ignores(rel))
|
|
549
647
|
continue;
|
|
550
648
|
if (statusCode === '??') {
|
|
551
649
|
out.added.push(filePath);
|
|
552
650
|
}
|
|
553
|
-
else if (statusCode.includes('D')) {
|
|
554
|
-
out.deleted.push(filePath);
|
|
555
|
-
}
|
|
556
651
|
else {
|
|
557
652
|
// M, MM, AM, A (staged), etc. — treat as modified
|
|
558
653
|
out.modified.push(filePath);
|
|
@@ -562,11 +657,11 @@ function collectGitStatus(repoDir, prefix, out) {
|
|
|
562
657
|
// nested deeper) and under this repo's gitignored dirs.
|
|
563
658
|
for (const rel of untrackedDirs) {
|
|
564
659
|
for (const repoRel of findNestedGitRepos(path.join(repoDir, rel), rel)) {
|
|
565
|
-
collectGitStatus(path.join(repoDir, repoRel), prefix + repoRel, out);
|
|
660
|
+
collectGitStatus(path.join(repoDir, repoRel), prefix + repoRel, out, overrides);
|
|
566
661
|
}
|
|
567
662
|
}
|
|
568
663
|
for (const rel of findIgnoredEmbeddedRepos(repoDir)) {
|
|
569
|
-
collectGitStatus(path.join(repoDir, rel), prefix + rel, out);
|
|
664
|
+
collectGitStatus(path.join(repoDir, rel), prefix + rel, out, overrides);
|
|
570
665
|
}
|
|
571
666
|
}
|
|
572
667
|
/**
|
|
@@ -577,13 +672,15 @@ function collectGitStatus(repoDir, prefix, out) {
|
|
|
577
672
|
* projects, falls back to a filesystem walk that parses .gitignore itself.
|
|
578
673
|
*/
|
|
579
674
|
function scanDirectory(rootDir, onProgress) {
|
|
675
|
+
// Custom extension → language overrides from the project's codegraph.json.
|
|
676
|
+
const overrides = (0, project_config_1.loadExtensionOverrides)(rootDir);
|
|
580
677
|
// Fast path: use git to get all visible files (respects .gitignore everywhere)
|
|
581
678
|
const gitFiles = getGitVisibleFiles(rootDir);
|
|
582
679
|
if (gitFiles) {
|
|
583
680
|
const files = [];
|
|
584
681
|
let count = 0;
|
|
585
682
|
for (const filePath of gitFiles) {
|
|
586
|
-
if ((0, grammars_1.isSourceFile)(filePath)) {
|
|
683
|
+
if ((0, grammars_1.isSourceFile)(filePath, overrides)) {
|
|
587
684
|
files.push(filePath);
|
|
588
685
|
count++;
|
|
589
686
|
onProgress?.(count, filePath);
|
|
@@ -599,12 +696,14 @@ function scanDirectory(rootDir, onProgress) {
|
|
|
599
696
|
* allowing worker threads to receive and render progress messages.
|
|
600
697
|
*/
|
|
601
698
|
async function scanDirectoryAsync(rootDir, onProgress) {
|
|
699
|
+
// Custom extension → language overrides from the project's codegraph.json.
|
|
700
|
+
const overrides = (0, project_config_1.loadExtensionOverrides)(rootDir);
|
|
602
701
|
const gitFiles = getGitVisibleFiles(rootDir);
|
|
603
702
|
if (gitFiles) {
|
|
604
703
|
const files = [];
|
|
605
704
|
let count = 0;
|
|
606
705
|
for (const filePath of gitFiles) {
|
|
607
|
-
if ((0, grammars_1.isSourceFile)(filePath)) {
|
|
706
|
+
if ((0, grammars_1.isSourceFile)(filePath, overrides)) {
|
|
608
707
|
files.push(filePath);
|
|
609
708
|
count++;
|
|
610
709
|
onProgress?.(count, filePath);
|
|
@@ -625,6 +724,8 @@ function scanDirectoryWalk(rootDir, onProgress) {
|
|
|
625
724
|
const files = [];
|
|
626
725
|
let count = 0;
|
|
627
726
|
const visitedDirs = new Set();
|
|
727
|
+
// Custom extension → language overrides from the project's codegraph.json.
|
|
728
|
+
const overrides = (0, project_config_1.loadExtensionOverrides)(rootDir);
|
|
628
729
|
const loadIgnore = (dir) => {
|
|
629
730
|
const giPath = path.join(dir, '.gitignore');
|
|
630
731
|
if (!fs.existsSync(giPath))
|
|
@@ -691,7 +792,7 @@ function scanDirectoryWalk(rootDir, onProgress) {
|
|
|
691
792
|
}
|
|
692
793
|
}
|
|
693
794
|
else if (stat.isFile()) {
|
|
694
|
-
if (!isIgnored(fullPath, false, active) && (0, grammars_1.isSourceFile)(relativePath)) {
|
|
795
|
+
if (!isIgnored(fullPath, false, active) && (0, grammars_1.isSourceFile)(relativePath, overrides)) {
|
|
695
796
|
files.push(relativePath);
|
|
696
797
|
count++;
|
|
697
798
|
onProgress?.(count, relativePath);
|
|
@@ -709,7 +810,7 @@ function scanDirectoryWalk(rootDir, onProgress) {
|
|
|
709
810
|
}
|
|
710
811
|
}
|
|
711
812
|
else if (entry.isFile()) {
|
|
712
|
-
if (!isIgnored(fullPath, false, active) && (0, grammars_1.isSourceFile)(relativePath)) {
|
|
813
|
+
if (!isIgnored(fullPath, false, active) && (0, grammars_1.isSourceFile)(relativePath, overrides)) {
|
|
713
814
|
files.push(relativePath);
|
|
714
815
|
count++;
|
|
715
816
|
onProgress?.(count, relativePath);
|
|
@@ -823,6 +924,10 @@ class ExtractionOrchestrator {
|
|
|
823
924
|
let filesErrored = 0;
|
|
824
925
|
let totalNodes = 0;
|
|
825
926
|
let totalEdges = 0;
|
|
927
|
+
// Custom extension → language overrides from the project's codegraph.json.
|
|
928
|
+
// Threaded into language detection so custom-extension files load the right
|
|
929
|
+
// grammar and store under the mapped language.
|
|
930
|
+
const overrides = (0, project_config_1.loadExtensionOverrides)(this.rootDir);
|
|
826
931
|
const log = verbose
|
|
827
932
|
? (msg) => { console.log(`[worker] ${msg}`); }
|
|
828
933
|
: (_msg) => { };
|
|
@@ -872,7 +977,7 @@ class ExtractionOrchestrator {
|
|
|
872
977
|
});
|
|
873
978
|
await new Promise(resolve => setImmediate(resolve));
|
|
874
979
|
// Detect needed languages and load grammars in the parse worker
|
|
875
|
-
const neededLanguages = [...new Set(files.map((f) => (0, grammars_1.detectLanguage)(f)))];
|
|
980
|
+
const neededLanguages = [...new Set(files.map((f) => (0, grammars_1.detectLanguage)(f, undefined, overrides)))];
|
|
876
981
|
// .h files default to 'c' but may be C++ — ensure cpp grammar is loaded when c is needed
|
|
877
982
|
if (neededLanguages.includes('c') && !neededLanguages.includes('cpp')) {
|
|
878
983
|
neededLanguages.push('cpp');
|
|
@@ -971,9 +1076,13 @@ class ExtractionOrchestrator {
|
|
|
971
1076
|
w.terminate().catch(() => { });
|
|
972
1077
|
}
|
|
973
1078
|
async function requestParse(filePath, content) {
|
|
1079
|
+
// Resolve the language on the main thread (where the project's
|
|
1080
|
+
// codegraph.json overrides are loaded) and hand it to the worker, so the
|
|
1081
|
+
// worker never needs the override map itself.
|
|
1082
|
+
const language = (0, grammars_1.detectLanguage)(filePath, content, overrides);
|
|
974
1083
|
if (!WorkerClass) {
|
|
975
1084
|
// In-process fallback
|
|
976
|
-
return (0, tree_sitter_1.extractFromSource)(filePath, content,
|
|
1085
|
+
return (0, tree_sitter_1.extractFromSource)(filePath, content, language, frameworkNames);
|
|
977
1086
|
}
|
|
978
1087
|
// Recycle the worker before the next parse if we've hit the threshold.
|
|
979
1088
|
// This destroys the WASM linear memory (which can grow but never shrink)
|
|
@@ -998,7 +1107,7 @@ class ExtractionOrchestrator {
|
|
|
998
1107
|
worker.terminate().catch(() => { });
|
|
999
1108
|
}, timeoutMs);
|
|
1000
1109
|
pendingParses.set(id, { resolve, reject, timer });
|
|
1001
|
-
worker.postMessage({ type: 'parse', id, filePath, content, frameworkNames });
|
|
1110
|
+
worker.postMessage({ type: 'parse', id, filePath, content, frameworkNames, language });
|
|
1002
1111
|
});
|
|
1003
1112
|
}
|
|
1004
1113
|
for (let i = 0; i < files.length; i += FILE_IO_BATCH_SIZE) {
|
|
@@ -1020,7 +1129,10 @@ class ExtractionOrchestrator {
|
|
|
1020
1129
|
// Read files in parallel (with path validation before any I/O)
|
|
1021
1130
|
const fileContents = await Promise.all(batch.map(async (fp) => {
|
|
1022
1131
|
try {
|
|
1023
|
-
|
|
1132
|
+
// Indexing read: follow in-root symlinks the directory walk already
|
|
1133
|
+
// descended into (the `../` guard still applies) so files reached
|
|
1134
|
+
// via an in-root symlink-to-outside still index (#935).
|
|
1135
|
+
const fullPath = (0, utils_1.validatePathWithinRoot)(this.rootDir, fp, { allowSymlinkEscape: true });
|
|
1024
1136
|
if (!fullPath) {
|
|
1025
1137
|
(0, errors_1.logWarn)('Path traversal blocked in batch reader', { filePath: fp });
|
|
1026
1138
|
return { filePath: fp, content: null, stats: null, error: new Error('Path traversal blocked') };
|
|
@@ -1104,7 +1216,7 @@ class ExtractionOrchestrator {
|
|
|
1104
1216
|
processed++;
|
|
1105
1217
|
// Store in database on main thread (SQLite is not thread-safe)
|
|
1106
1218
|
if (result.nodes.length > 0 || result.errors.length === 0) {
|
|
1107
|
-
const language = (0, grammars_1.detectLanguage)(filePath, content);
|
|
1219
|
+
const language = (0, grammars_1.detectLanguage)(filePath, content, overrides);
|
|
1108
1220
|
this.storeExtractionResult(filePath, content, language, stats, result);
|
|
1109
1221
|
}
|
|
1110
1222
|
if (result.errors.length > 0) {
|
|
@@ -1126,7 +1238,7 @@ class ExtractionOrchestrator {
|
|
|
1126
1238
|
// Files with no symbols but no errors (yaml, twig, properties) are
|
|
1127
1239
|
// tracked at the file level — count them as indexed so the CLI
|
|
1128
1240
|
// doesn't misleadingly report "No files found to index".
|
|
1129
|
-
const lang = (0, grammars_1.detectLanguage)(filePath, content);
|
|
1241
|
+
const lang = (0, grammars_1.detectLanguage)(filePath, content, overrides);
|
|
1130
1242
|
if ((0, grammars_1.isFileLevelOnlyLanguage)(lang)) {
|
|
1131
1243
|
filesIndexed++;
|
|
1132
1244
|
}
|
|
@@ -1179,7 +1291,7 @@ class ExtractionOrchestrator {
|
|
|
1179
1291
|
continue;
|
|
1180
1292
|
}
|
|
1181
1293
|
if (result.nodes.length > 0 || result.errors.length === 0) {
|
|
1182
|
-
const language = (0, grammars_1.detectLanguage)(filePath, content);
|
|
1294
|
+
const language = (0, grammars_1.detectLanguage)(filePath, content, overrides);
|
|
1183
1295
|
const stats = await fsp.stat(path.join(this.rootDir, filePath));
|
|
1184
1296
|
this.storeExtractionResult(filePath, content, language, stats, result);
|
|
1185
1297
|
const idx = errors.indexOf(errEntry);
|
|
@@ -1227,7 +1339,7 @@ class ExtractionOrchestrator {
|
|
|
1227
1339
|
continue;
|
|
1228
1340
|
}
|
|
1229
1341
|
if (result.nodes.length > 0 || result.errors.length === 0) {
|
|
1230
|
-
const language = (0, grammars_1.detectLanguage)(filePath, fullContent);
|
|
1342
|
+
const language = (0, grammars_1.detectLanguage)(filePath, fullContent, overrides);
|
|
1231
1343
|
const stats = await fsp.stat(path.join(this.rootDir, filePath));
|
|
1232
1344
|
this.storeExtractionResult(filePath, fullContent, language, stats, result);
|
|
1233
1345
|
const idx = errors.indexOf(errEntry);
|
|
@@ -1307,7 +1419,8 @@ class ExtractionOrchestrator {
|
|
|
1307
1419
|
* Index a single file
|
|
1308
1420
|
*/
|
|
1309
1421
|
async indexFile(relativePath) {
|
|
1310
|
-
|
|
1422
|
+
// Indexing read: follow in-root symlinks (the `../` guard still applies), #935.
|
|
1423
|
+
const fullPath = (0, utils_1.validatePathWithinRoot)(this.rootDir, relativePath, { allowSymlinkEscape: true });
|
|
1311
1424
|
if (!fullPath) {
|
|
1312
1425
|
return {
|
|
1313
1426
|
nodes: [],
|
|
@@ -1347,8 +1460,8 @@ class ExtractionOrchestrator {
|
|
|
1347
1460
|
* Used by the parallel batch reader to avoid redundant file I/O.
|
|
1348
1461
|
*/
|
|
1349
1462
|
async indexFileWithContent(relativePath, content, stats) {
|
|
1350
|
-
// Prevent
|
|
1351
|
-
const fullPath = (0, utils_1.validatePathWithinRoot)(this.rootDir, relativePath);
|
|
1463
|
+
// Prevent `../` traversal; follow in-root symlinks like the directory walk (#935).
|
|
1464
|
+
const fullPath = (0, utils_1.validatePathWithinRoot)(this.rootDir, relativePath, { allowSymlinkEscape: true });
|
|
1352
1465
|
if (!fullPath) {
|
|
1353
1466
|
(0, errors_1.logWarn)('Path traversal blocked in indexFileWithContent', { relativePath });
|
|
1354
1467
|
return {
|
|
@@ -1376,8 +1489,8 @@ class ExtractionOrchestrator {
|
|
|
1376
1489
|
durationMs: 0,
|
|
1377
1490
|
};
|
|
1378
1491
|
}
|
|
1379
|
-
// Detect language
|
|
1380
|
-
const language = (0, grammars_1.detectLanguage)(relativePath, content);
|
|
1492
|
+
// Detect language (honoring the project's codegraph.json extension overrides)
|
|
1493
|
+
const language = (0, grammars_1.detectLanguage)(relativePath, content, (0, project_config_1.loadExtensionOverrides)(this.rootDir));
|
|
1381
1494
|
if (!(0, grammars_1.isLanguageSupported)(language)) {
|
|
1382
1495
|
return {
|
|
1383
1496
|
nodes: [],
|
|
@@ -1408,6 +1521,25 @@ class ExtractionOrchestrator {
|
|
|
1408
1521
|
if (existingFile && existingFile.contentHash === contentHash) {
|
|
1409
1522
|
return; // No changes
|
|
1410
1523
|
}
|
|
1524
|
+
// Snapshot incoming cross-file edges BEFORE deleting this file's nodes.
|
|
1525
|
+
// `deleteFile` cascades to delete every edge whose source OR target is a
|
|
1526
|
+
// node in this file (edges.FK ... ON DELETE CASCADE). Edges whose SOURCE is
|
|
1527
|
+
// in this file are re-emitted by the extractor below, but edges whose SOURCE
|
|
1528
|
+
// is in a *different* (unchanged) file are not — they would be silently
|
|
1529
|
+
// dropped, which is issue #899: re-indexing a callee file severs `calls`/
|
|
1530
|
+
// `references` edges from callers that import it via module-attribute
|
|
1531
|
+
// access (`pkg.mod.fn(...)`).
|
|
1532
|
+
//
|
|
1533
|
+
// We snapshot the edge plus the target node's (name, kind) so we can
|
|
1534
|
+
// re-resolve to the re-indexed target's NEW id. Node ids are
|
|
1535
|
+
// `sha256(filePath:kind:name:line)`, so any line shift in the callee file
|
|
1536
|
+
// (e.g. a docstring-only edit above the symbol) changes every target id and
|
|
1537
|
+
// a naive re-insert by old id would silently drop every edge. Matching by
|
|
1538
|
+
// (filePath, kind, name) is stable across line shifts; if the symbol was
|
|
1539
|
+
// renamed/removed, no match is found and the edge stays dropped (correct).
|
|
1540
|
+
const crossFileIncomingEdges = existingFile
|
|
1541
|
+
? this.queries.getCrossFileIncomingEdgesWithTarget(filePath)
|
|
1542
|
+
: [];
|
|
1411
1543
|
// Delete existing data for this file
|
|
1412
1544
|
if (existingFile) {
|
|
1413
1545
|
this.queries.deleteFile(filePath);
|
|
@@ -1428,6 +1560,31 @@ class ExtractionOrchestrator {
|
|
|
1428
1560
|
this.queries.insertEdges(validEdges);
|
|
1429
1561
|
}
|
|
1430
1562
|
}
|
|
1563
|
+
// Re-insert cross-file incoming edges snapshotted before the delete,
|
|
1564
|
+
// re-resolving each edge's target to the re-indexed node's new id by
|
|
1565
|
+
// (filePath, kind, name). Node ids include the source line, so any line
|
|
1566
|
+
// shift in the callee file (e.g. a docstring-only edit above the symbol)
|
|
1567
|
+
// changes every target id and a naive re-insert by old id would drop them
|
|
1568
|
+
// all. `insertEdges` still filters to endpoints that exist, so edges whose
|
|
1569
|
+
// caller (source) was deleted, or whose callee (target) was renamed/removed
|
|
1570
|
+
// during the re-index (no match in `newTargetIds`), are dropped. This
|
|
1571
|
+
// closes the #899 edge-drop on `sync`.
|
|
1572
|
+
if (crossFileIncomingEdges.length > 0) {
|
|
1573
|
+
const newNodesByKindName = new Map();
|
|
1574
|
+
for (const n of validNodes) {
|
|
1575
|
+
newNodesByKindName.set(`${n.kind}\0${n.name}`, n.id);
|
|
1576
|
+
}
|
|
1577
|
+
const reinserted = [];
|
|
1578
|
+
for (const e of crossFileIncomingEdges) {
|
|
1579
|
+
const newTargetId = newNodesByKindName.get(`${e.targetKind}\0${e.targetName}`);
|
|
1580
|
+
if (newTargetId) {
|
|
1581
|
+
reinserted.push({ source: e.source, target: newTargetId, kind: e.kind, metadata: e.metadata, line: e.line, column: e.column, provenance: e.provenance });
|
|
1582
|
+
}
|
|
1583
|
+
}
|
|
1584
|
+
if (reinserted.length > 0) {
|
|
1585
|
+
this.queries.insertEdges(reinserted);
|
|
1586
|
+
}
|
|
1587
|
+
}
|
|
1431
1588
|
// Insert unresolved references in batch with denormalized filePath/language
|
|
1432
1589
|
if (result.unresolvedReferences.length > 0) {
|
|
1433
1590
|
const insertedIds = new Set(validNodes.map((n) => n.id));
|
|
@@ -1487,7 +1644,7 @@ class ExtractionOrchestrator {
|
|
|
1487
1644
|
// whether or not the project uses git, and crucially also catches committed
|
|
1488
1645
|
// changes from `git pull`/`checkout`/`merge`/`rebase` — which `git status`
|
|
1489
1646
|
// cannot see, because the working tree is clean afterward.
|
|
1490
|
-
const currentFiles =
|
|
1647
|
+
const currentFiles = await scanDirectoryAsync(this.rootDir);
|
|
1491
1648
|
filesChecked = currentFiles.length;
|
|
1492
1649
|
const currentSet = new Set(currentFiles);
|
|
1493
1650
|
const trackedFiles = this.queries.getAllFiles();
|
|
@@ -1498,14 +1655,26 @@ class ExtractionOrchestrator {
|
|
|
1498
1655
|
// Removals: tracked in the DB but no longer a present source file. Check the
|
|
1499
1656
|
// filesystem directly — `scanDirectory` (via `git ls-files`) still lists a
|
|
1500
1657
|
// file deleted from disk but not yet staged, so set membership alone misses it.
|
|
1658
|
+
// `reconcileChecks` drives the cooperative yield shared with the adds/mods loop
|
|
1659
|
+
// below (see SYNC_RECONCILE_YIELD_INTERVAL / issue #905).
|
|
1660
|
+
let reconcileChecks = 0;
|
|
1501
1661
|
for (const tracked of trackedFiles) {
|
|
1502
1662
|
if (!currentSet.has(tracked.path) || !fs.existsSync(path.join(this.rootDir, tracked.path))) {
|
|
1503
1663
|
this.queries.deleteFile(tracked.path);
|
|
1504
1664
|
filesRemoved++;
|
|
1505
1665
|
}
|
|
1666
|
+
if (++reconcileChecks % SYNC_RECONCILE_YIELD_INTERVAL === 0) {
|
|
1667
|
+
await new Promise((resolve) => setImmediate(resolve));
|
|
1668
|
+
}
|
|
1506
1669
|
}
|
|
1507
1670
|
// Adds / modifications.
|
|
1508
1671
|
for (const filePath of currentFiles) {
|
|
1672
|
+
// Same cooperative yield as the removals loop — this is the other O(files)
|
|
1673
|
+
// synchronous-stat loop that wedges the main thread on a large repo (#905).
|
|
1674
|
+
// Yield at the top of the body so the `continue` fast-paths below still hit it.
|
|
1675
|
+
if (++reconcileChecks % SYNC_RECONCILE_YIELD_INTERVAL === 0) {
|
|
1676
|
+
await new Promise((resolve) => setImmediate(resolve));
|
|
1677
|
+
}
|
|
1509
1678
|
const fullPath = path.join(this.rootDir, filePath);
|
|
1510
1679
|
const tracked = trackedMap.get(filePath);
|
|
1511
1680
|
// Cheap pre-filter: an already-indexed file whose size AND mtime both match
|
|
@@ -1548,7 +1717,8 @@ class ExtractionOrchestrator {
|
|
|
1548
1717
|
}
|
|
1549
1718
|
// Load only grammars needed for changed files
|
|
1550
1719
|
if (filesToIndex.length > 0) {
|
|
1551
|
-
const
|
|
1720
|
+
const overrides = (0, project_config_1.loadExtensionOverrides)(this.rootDir);
|
|
1721
|
+
const neededLanguages = [...new Set(filesToIndex.map((f) => (0, grammars_1.detectLanguage)(f, undefined, overrides)))];
|
|
1552
1722
|
// .h files default to 'c' but may be C++ — ensure cpp grammar is loaded
|
|
1553
1723
|
if (neededLanguages.includes('c') && !neededLanguages.includes('cpp')) {
|
|
1554
1724
|
neededLanguages.push('cpp');
|