scip-query 0.6.4 → 0.6.5
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/README.md +31 -29
- package/dist/augment-vue-worker.js +2 -0
- package/dist/chunk-2ZGHRI2A.js +5 -0
- package/dist/chunk-32R4VYYA.js +2 -0
- package/dist/chunk-3UB2DPLP.js +2 -0
- package/dist/chunk-4X7C236P.js +84 -0
- package/dist/chunk-5LQ6CVX3.js +2 -0
- package/dist/chunk-5YYMKE3G.js +70 -0
- package/dist/chunk-7LSCW7NF.js +6 -0
- package/dist/chunk-7X7FLQC5.js +2 -0
- package/dist/chunk-A5UNS4DR.js +4 -0
- package/dist/chunk-BNCTPTVX.js +2 -0
- package/dist/{chunk-CGAO6FHN.js → chunk-C5BFS23M.js} +2 -2
- package/dist/{chunk-OOMAS234.js → chunk-DRLWW74T.js} +2 -2
- package/dist/chunk-EB5IVUNU.js +2 -0
- package/dist/{chunk-ZE3BTHTS.js → chunk-ERRUE5G4.js} +4 -4
- package/dist/chunk-F4KR22Z2.js +2 -0
- package/dist/chunk-FG6A6ZUP.js +2 -0
- package/dist/chunk-FHSD5RKF.js +19 -0
- package/dist/chunk-FVVEIGP3.js +5 -0
- package/dist/chunk-GBDZY73J.js +2 -0
- package/dist/{chunk-4TYGGOLO.js → chunk-H4DXD2FB.js} +1 -1
- package/dist/chunk-HUASU3AD.js +71 -0
- package/dist/chunk-IJWIYZO5.js +2 -0
- package/dist/chunk-K6H3XJQW.js +7 -0
- package/dist/{chunk-KYT47WU2.js → chunk-KAM4C6ZD.js} +1 -1
- package/dist/{chunk-IDCWMWWP.js → chunk-KTCODJNQ.js} +3 -3
- package/dist/chunk-LJ2YWNQF.js +2 -0
- package/dist/chunk-LT2CPEQ4.js +2 -0
- package/dist/chunk-M5QTG55L.js +2 -0
- package/dist/chunk-MKFH7QJG.js +7 -0
- package/dist/chunk-MO32JMOD.js +12 -0
- package/dist/chunk-MO65UK5V.js +6 -0
- package/dist/chunk-MTK3JAJT.js +2 -0
- package/dist/{chunk-6UJ5PXER.js → chunk-MXWC53GJ.js} +4 -4
- package/dist/{chunk-IVT2U2BV.js → chunk-OQZF2DQJ.js} +3 -3
- package/dist/chunk-PBFMZKXE.js +6 -0
- package/dist/{chunk-LAXFZ3UW.js → chunk-PFMGJ4BR.js} +4 -4
- package/dist/{chunk-QID23O53.js → chunk-PK4U6NWP.js} +2 -2
- package/dist/{chunk-GALIM3IE.js → chunk-Q2ALKKSE.js} +4 -4
- package/dist/chunk-QFCK6WV2.js +39 -0
- package/dist/chunk-QFZE73XF.js +84 -0
- package/dist/chunk-QRYEOK3M.js +2 -0
- package/dist/{chunk-LORWXBOO.js → chunk-RKTDEIHF.js} +1 -1
- package/dist/chunk-ROWAEEOD.js +2 -0
- package/dist/chunk-RT5PV5JQ.js +7 -0
- package/dist/chunk-TLRA5TR6.js +2 -0
- package/dist/chunk-U5MVUPOO.js +2 -0
- package/dist/chunk-URUVLDM7.js +29 -0
- package/dist/chunk-WHGCGENP.js +16 -0
- package/dist/chunk-WIIZF5FP.js +2 -0
- package/dist/chunk-WNMAH3P7.js +2 -0
- package/dist/chunk-XV3XUZ3X.js +11 -0
- package/dist/chunk-YDKWDTAW.js +2 -0
- package/dist/{chunk-5OVBASGY.js → chunk-YDNCX5PF.js} +2 -2
- package/dist/chunk-YU25IHJX.js +90 -0
- package/dist/{chunk-AW3QJT4O.js → chunk-Z5CTXSWT.js} +3 -3
- package/dist/chunk-ZFCQQ4B5.js +2 -0
- package/dist/chunk-ZHHMG4UC.js +114 -0
- package/dist/cli.js +487 -388
- package/dist/{db-DKhNQ75l.d.ts → db-BZPa7dzJ.d.ts} +19 -9
- package/dist/index.d.ts +221 -13
- package/dist/index.js +45 -31
- package/dist/postinstall.js +1 -1
- package/dist/queries/affected.d.ts +1 -1
- package/dist/queries/affected.js +1 -1
- package/dist/queries/bottlenecks.d.ts +1 -1
- package/dist/queries/bottlenecks.js +1 -1
- package/dist/queries/by-kind.d.ts +1 -1
- package/dist/queries/by-kind.js +1 -1
- package/dist/queries/call-graph.d.ts +1 -1
- package/dist/queries/call-graph.js +1 -1
- package/dist/queries/change-surface.d.ts +1 -1
- package/dist/queries/change-surface.js +1 -1
- package/dist/queries/code.d.ts +1 -1
- package/dist/queries/code.js +1 -1
- package/dist/queries/complexity-hotspots.d.ts +1 -1
- package/dist/queries/complexity-hotspots.js +1 -1
- package/dist/queries/complexity.d.ts +1 -1
- package/dist/queries/complexity.js +1 -1
- package/dist/queries/convergence.d.ts +1 -1
- package/dist/queries/convergence.js +1 -1
- package/dist/queries/coupling.d.ts +1 -1
- package/dist/queries/coupling.js +1 -1
- package/dist/queries/cycles.d.ts +1 -1
- package/dist/queries/cycles.js +1 -1
- package/dist/queries/dataflow.d.ts +1 -1
- package/dist/queries/dataflow.js +1 -1
- package/dist/queries/dead.d.ts +1 -1
- package/dist/queries/dead.js +1 -1
- package/dist/queries/deep-chains.d.ts +1 -1
- package/dist/queries/deep-chains.js +1 -1
- package/dist/queries/deps.d.ts +1 -1
- package/dist/queries/deps.js +1 -1
- package/dist/queries/diff-impact.d.ts +1 -1
- package/dist/queries/diff-impact.js +1 -1
- package/dist/queries/drift-policy.d.ts +6 -0
- package/dist/queries/drift-policy.js +2 -0
- package/dist/queries/drift.d.ts +1 -1
- package/dist/queries/drift.js +1 -1
- package/dist/queries/extract-candidates.d.ts +1 -1
- package/dist/queries/extract-candidates.js +1 -1
- package/dist/queries/fan.d.ts +1 -1
- package/dist/queries/fan.js +1 -1
- package/dist/queries/files.d.ts +1 -1
- package/dist/queries/files.js +1 -1
- package/dist/queries/health.d.ts +1 -1
- package/dist/queries/health.js +1 -1
- package/dist/queries/hierarchy.d.ts +1 -1
- package/dist/queries/hierarchy.js +1 -1
- package/dist/queries/hotspots.d.ts +1 -1
- package/dist/queries/hotspots.js +1 -1
- package/dist/queries/imports.d.ts +1 -1
- package/dist/queries/imports.js +1 -1
- package/dist/queries/index.d.ts +1 -1
- package/dist/queries/index.js +1 -1
- package/dist/queries/isolated.d.ts +1 -1
- package/dist/queries/isolated.js +1 -1
- package/dist/queries/members.d.ts +1 -1
- package/dist/queries/members.js +1 -1
- package/dist/queries/methods.d.ts +1 -1
- package/dist/queries/methods.js +1 -1
- package/dist/queries/outline.d.ts +1 -1
- package/dist/queries/outline.js +1 -1
- package/dist/queries/passthrough-candidates.d.ts +1 -1
- package/dist/queries/passthrough-candidates.js +1 -1
- package/dist/queries/redundant-reexports.d.ts +1 -1
- package/dist/queries/redundant-reexports.js +1 -1
- package/dist/queries/refs.d.ts +1 -1
- package/dist/queries/refs.js +1 -1
- package/dist/queries/similar-chains.d.ts +1 -1
- package/dist/queries/similar-chains.js +1 -1
- package/dist/queries/similar-files.d.ts +1 -1
- package/dist/queries/similar-files.js +1 -1
- package/dist/queries/similar-signatures.d.ts +1 -1
- package/dist/queries/similar-signatures.js +1 -1
- package/dist/queries/similar.d.ts +1 -1
- package/dist/queries/similar.js +1 -1
- package/dist/queries/slice.d.ts +1 -1
- package/dist/queries/slice.js +1 -1
- package/dist/queries/stale-abstractions.d.ts +1 -1
- package/dist/queries/stale-abstractions.js +1 -1
- package/dist/queries/stats.d.ts +1 -1
- package/dist/queries/stats.js +1 -1
- package/dist/queries/surface.d.ts +1 -1
- package/dist/queries/surface.js +1 -1
- package/dist/queries/symbols.d.ts +1 -1
- package/dist/queries/symbols.js +1 -1
- package/dist/queries/system.d.ts +1 -1
- package/dist/queries/system.js +1 -1
- package/dist/queries/trace.d.ts +1 -1
- package/dist/queries/trace.js +1 -1
- package/dist/queries/wrapper-candidates.d.ts +1 -1
- package/dist/queries/wrapper-candidates.js +1 -1
- package/dist/reindex-worker.js +10 -63
- package/package.json +4 -2
- package/dist/chunk-2DQK2IDZ.js +0 -19
- package/dist/chunk-4HCKXL7T.js +0 -6
- package/dist/chunk-4Q2D5BMS.js +0 -2
- package/dist/chunk-5IM4IQ6N.js +0 -2
- package/dist/chunk-5NSYCQWM.js +0 -6
- package/dist/chunk-6QKHOBC6.js +0 -2
- package/dist/chunk-6U5UHIRD.js +0 -5
- package/dist/chunk-AQFXC7CF.js +0 -2
- package/dist/chunk-BSONDC3H.js +0 -7
- package/dist/chunk-ECT6SOBO.js +0 -2
- package/dist/chunk-FFE3RZ65.js +0 -2
- package/dist/chunk-FT4WPAEX.js +0 -65
- package/dist/chunk-G6HYVVRV.js +0 -2
- package/dist/chunk-GVVKLMXG.js +0 -10
- package/dist/chunk-HVM6SQPQ.js +0 -2
- package/dist/chunk-IJO2HZFL.js +0 -2
- package/dist/chunk-INPQVQ6O.js +0 -12
- package/dist/chunk-JSBWVSES.js +0 -39
- package/dist/chunk-MFVPKCS5.js +0 -2
- package/dist/chunk-MWCN46ZX.js +0 -89
- package/dist/chunk-N3Z2SJCR.js +0 -2
- package/dist/chunk-NKU7Z242.js +0 -8
- package/dist/chunk-P6IUCZA3.js +0 -24
- package/dist/chunk-PM3GTZ4I.js +0 -2
- package/dist/chunk-QL5MJOVA.js +0 -84
- package/dist/chunk-QWFK4QOQ.js +0 -2
- package/dist/chunk-RBYC6PHE.js +0 -2
- package/dist/chunk-TS7E5XBZ.js +0 -29
- package/dist/chunk-TUC6IWTY.js +0 -2
- package/dist/chunk-USMVRM6F.js +0 -2
- package/dist/chunk-VTZPTRKS.js +0 -7
- package/dist/chunk-WUYKGQSK.js +0 -2
- package/dist/chunk-X7LOLGYY.js +0 -2
- package/dist/chunk-XGOEZVMA.js +0 -7
- package/dist/chunk-Y6NOLG4X.js +0 -70
- package/dist/chunk-YVQ7CIKO.js +0 -6
- package/dist/chunk-ZIFKQQW2.js +0 -4
- package/dist/chunk-ZOR6FW74.js +0 -2
- package/dist/chunk-ZPZLVFJQ.js +0 -41
- package/dist/chunk-ZZ3F6P3X.js +0 -2
package/dist/chunk-MWCN46ZX.js
DELETED
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
import{u as p}from"./chunk-QL5MJOVA.js";import{b as N,c as E,f as R,g as I}from"./chunk-5IM4IQ6N.js";function T(e,t){let n=v(e,t.trim());if(n)return n;let i=t.match(/^(.+):(\d+)-(\d+)$/);if(i){let[,c,_,h]=i,u=Math.max(0,parseInt(_,10)-1),f=Math.max(u,parseInt(h,10)-1),m=e.get(`SELECT gs.id, gs.symbol, der.document_id, der.start_line, der.end_line, d.relative_path
|
|
2
|
-
FROM global_symbols gs
|
|
3
|
-
JOIN defn_enclosing_ranges der ON gs.id = der.symbol_id
|
|
4
|
-
JOIN documents d ON der.document_id = d.id
|
|
5
|
-
WHERE d.relative_path LIKE ?
|
|
6
|
-
AND der.start_line <= ? AND der.end_line >= ?
|
|
7
|
-
${e.pathExclusionsFor("d")}
|
|
8
|
-
ORDER BY (der.end_line - der.start_line) ASC
|
|
9
|
-
LIMIT 1`,`%${c}%`,u,f);if(m||(m=e.get(`SELECT gs.id, gs.symbol, c.document_id, MIN(c.start_line) AS start_line, MAX(c.end_line) AS end_line, d.relative_path
|
|
10
|
-
FROM global_symbols gs
|
|
11
|
-
JOIN mentions m ON m.symbol_id = gs.id
|
|
12
|
-
JOIN chunks c ON m.chunk_id = c.id
|
|
13
|
-
JOIN documents d ON c.document_id = d.id
|
|
14
|
-
WHERE m.role = 1
|
|
15
|
-
AND d.relative_path LIKE ?
|
|
16
|
-
AND c.start_line <= ? AND c.end_line >= ?
|
|
17
|
-
${e.pathExclusionsFor("d")}
|
|
18
|
-
GROUP BY gs.id, gs.symbol, c.document_id, d.relative_path
|
|
19
|
-
ORDER BY (MAX(c.end_line) - MIN(c.start_line)) ASC
|
|
20
|
-
LIMIT 1`,`%${c}%`,u,f)),m&&!e.isIgnored(m.relative_path))return p(e,m)}let d=M(t),o=w(t),l=$(e,o),a=x(l,t,d);if(a&&!e.isIgnored(a.relative_path))return p(e,a);let r=null;for(let c of l){if(e.isIgnored(c.relative_path))continue;let _=D(c,t,d,o);_<=0||(!r||_>r.score)&&(r={row:c,score:_})}return r?p(e,r.row):null}function v(e,t){let i=e.get(`SELECT gs.id, gs.symbol, der.document_id, der.start_line, der.end_line, d.relative_path
|
|
21
|
-
FROM global_symbols gs
|
|
22
|
-
JOIN defn_enclosing_ranges der ON gs.id = der.symbol_id
|
|
23
|
-
JOIN documents d ON der.document_id = d.id
|
|
24
|
-
WHERE gs.symbol = ?
|
|
25
|
-
${e.pathExclusionsFor("d")}
|
|
26
|
-
ORDER BY d.relative_path, der.start_line
|
|
27
|
-
LIMIT 1`,t)??e.get(`SELECT
|
|
28
|
-
gs.id,
|
|
29
|
-
gs.symbol,
|
|
30
|
-
c.document_id,
|
|
31
|
-
MIN(c.start_line) AS start_line,
|
|
32
|
-
MAX(c.end_line) AS end_line,
|
|
33
|
-
d.relative_path
|
|
34
|
-
FROM global_symbols gs
|
|
35
|
-
JOIN mentions m ON m.symbol_id = gs.id
|
|
36
|
-
JOIN chunks c ON m.chunk_id = c.id
|
|
37
|
-
JOIN documents d ON c.document_id = d.id
|
|
38
|
-
WHERE gs.symbol = ?
|
|
39
|
-
AND m.role = 1
|
|
40
|
-
${e.pathExclusionsFor("d")}
|
|
41
|
-
GROUP BY gs.id, gs.symbol, c.document_id, d.relative_path
|
|
42
|
-
ORDER BY d.relative_path, start_line
|
|
43
|
-
LIMIT 1`,t);return!i||e.isIgnored(i.relative_path)?null:p(e,i)}function W(e,t){if("symbol"in t&&"relativePath"in t)return t;let n=A(e,t.symbolId)[0];return n?p(e,n):null}function A(e,t){let n=e.all(`SELECT gs.id, gs.symbol, der.document_id, der.start_line, der.end_line, d.relative_path, gs.display_name
|
|
44
|
-
FROM global_symbols gs
|
|
45
|
-
JOIN defn_enclosing_ranges der ON gs.id = der.symbol_id
|
|
46
|
-
JOIN documents d ON der.document_id = d.id
|
|
47
|
-
WHERE gs.id = ?
|
|
48
|
-
ORDER BY der.start_line, der.end_line`,t);return n.length>0?n:e.all(`SELECT
|
|
49
|
-
gs.id,
|
|
50
|
-
gs.symbol,
|
|
51
|
-
c.document_id,
|
|
52
|
-
MIN(c.start_line) AS start_line,
|
|
53
|
-
MAX(c.end_line) AS end_line,
|
|
54
|
-
d.relative_path,
|
|
55
|
-
gs.display_name
|
|
56
|
-
FROM global_symbols gs
|
|
57
|
-
JOIN mentions m ON m.symbol_id = gs.id
|
|
58
|
-
JOIN chunks c ON m.chunk_id = c.id
|
|
59
|
-
JOIN documents d ON c.document_id = d.id
|
|
60
|
-
WHERE gs.id = ?
|
|
61
|
-
AND m.role = 1
|
|
62
|
-
${e.pathExclusionsFor("d")}
|
|
63
|
-
GROUP BY gs.id, gs.symbol, c.document_id, d.relative_path, gs.display_name
|
|
64
|
-
ORDER BY start_line, end_line`,t)}function $(e,t){let n=t.map(()=>"(gs.symbol LIKE ? OR d.relative_path LIKE ? OR COALESCE(gs.display_name, '') LIKE ?)"),i=t.flatMap(o=>{let l=`%${o}%`;return[l,l,l]}),d=e.all(`SELECT gs.id, gs.symbol, der.document_id, der.start_line, der.end_line, d.relative_path, gs.display_name
|
|
65
|
-
FROM global_symbols gs
|
|
66
|
-
JOIN defn_enclosing_ranges der ON gs.id = der.symbol_id
|
|
67
|
-
JOIN documents d ON der.document_id = d.id
|
|
68
|
-
WHERE ${n.join(`
|
|
69
|
-
AND `)}
|
|
70
|
-
${e.pathExclusionsFor("d")}
|
|
71
|
-
LIMIT 200`,...i);return d.length>0?d:e.all(`SELECT
|
|
72
|
-
gs.id,
|
|
73
|
-
gs.symbol,
|
|
74
|
-
c.document_id,
|
|
75
|
-
MIN(c.start_line) AS start_line,
|
|
76
|
-
MAX(c.end_line) AS end_line,
|
|
77
|
-
d.relative_path,
|
|
78
|
-
gs.display_name
|
|
79
|
-
FROM global_symbols gs
|
|
80
|
-
JOIN mentions m ON m.symbol_id = gs.id
|
|
81
|
-
JOIN chunks c ON m.chunk_id = c.id
|
|
82
|
-
JOIN documents d ON c.document_id = d.id
|
|
83
|
-
WHERE m.role = 1
|
|
84
|
-
AND ${n.join(`
|
|
85
|
-
AND `)}
|
|
86
|
-
${e.pathExclusionsFor("d")}
|
|
87
|
-
GROUP BY gs.id, gs.symbol, c.document_id, d.relative_path, gs.display_name
|
|
88
|
-
LIMIT 200`,...i)}function D(e,t,n,i){let d=t.trim(),o=n,l=o.replace(/\(\)$/,""),a=t.toLowerCase(),r=n.toLowerCase(),c=r.replace(/\(\)$/,""),_=e.symbol,h=N(e.symbol),u=E(e.symbol),f=e.display_name??"",m=e.symbol.toLowerCase(),y=h.toLowerCase(),S=u.toLowerCase(),O=f.toLowerCase(),g=e.relative_path.toLowerCase(),L=/[/:.]/.test(n),s=0;return(_===d||_===o)&&(s+=1150),(h===d||h===o)&&(s+=1100),f===l&&(s+=980),u===l&&(s+=960),(`${u}()`===d||`${u}()`===o)&&(s+=955),(m===a||m===r)&&(s+=1e3),(y===a||y===r)&&(s+=950),(g===a||g===r)&&(s+=925),(g.endsWith(`/${r}`)||g.endsWith(`/${a}`))&&(s+=875),O===c&&(s+=850),S===c&&(s+=825),(`${S}()`===a||`${S}()`===r)&&(s+=820),(y.endsWith(`:${r}`)||y.endsWith(`:${c}`)||y.endsWith(`:${c}()`))&&(s+=800),m.includes(r)&&(s+=120),y.includes(r)&&(s+=140),g.includes(r)&&(s+=140),O.includes(r)&&(s+=110),i.every(C=>{let b=C.toLowerCase();return m.includes(b)||y.includes(b)||g.includes(b)||O.includes(b)})&&(s+=100+i.length*15),R(e.symbol)&&S===c&&(s+=60),!L&&I(e.symbol)&&(s-=160),s-=Math.min(50,Math.max(0,e.end_line-e.start_line)),s}function M(e){return e.trim().replace(/\(\)$/,"").replace(/\(.*$/,"")}function w(e){let t=M(e),n=t.split(/[^A-Za-z0-9_]+/).map(i=>i.trim()).filter(i=>i.length>0);return n.length>0?[...new Set(n)]:[t]}function x(e,t,n){let i=t.trim(),d=e.filter(o=>{let l=N(o.symbol),a=(o.display_name??"").trim();return o.symbol===i||l===i||l===n||a===i||a===n||`${a}()`===i||o.relative_path===i});return d.length===0?null:(d.sort((o,l)=>o.end_line-o.start_line-(l.end_line-l.start_line)||o.relative_path.localeCompare(l.relative_path)||o.symbol.localeCompare(l.symbol)),d[0]??null)}export{T as a,v as b,W as c};
|
|
89
|
-
//# sourceMappingURL=chunk-MWCN46ZX.js.map
|
package/dist/chunk-N3Z2SJCR.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
function o(t){let e=t.get("SELECT COUNT(*) as c FROM documents").c,s=t.get("SELECT COUNT(*) as c FROM global_symbols").c,c=t.get("SELECT COUNT(*) as c FROM mentions WHERE role = 1").c,n=t.get("SELECT COUNT(*) as c FROM mentions WHERE role != 1").c;return{documents:e,symbols:s,definitions:c,references:n,indexSizeBytes:t.sizeBytes(),lastBuilt:t.lastModified()}}export{o as a};
|
|
2
|
-
//# sourceMappingURL=chunk-N3Z2SJCR.js.map
|
package/dist/chunk-NKU7Z242.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import{a as B,b as ie,c as ae,d as G,f as F,g as ce,h as S}from"./chunk-QL5MJOVA.js";import{existsSync as ve,readFileSync as Ae}from"fs";import{join as Oe}from"path";import{existsSync as w}from"fs";import{basename as Le,dirname as j,extname as R,join as E,relative as A,resolve as P}from"path";var qe=ie("indexed-paths"),H=[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs",".vue"],K=[".py",".pyi"],C=[".java",".scala",".kt",".kts"],Z=[".rs"],ee=[".rb"],pe=[".c",".h",".cc",".cpp",".cxx",".hpp",".hh",".hxx"],L=[".cs",".vb"],te=[".dart"],X=[".php"],Ue=[H,K,C,Z,ee,pe,L,te,X];function $(e,r){return r.includes(R(e).toLowerCase())}function We(e){return $(e,K)}function Be(e){return $(e,C)}function Xe(e){return $(e,Z)}function Je(e){return $(e,ee)}function Fe(e){return $(e,pe)}function He(e){return $(e,L)}function le(e){return R(e).toLowerCase()===".vb"}function ze(e){return $(e,te)}function Ve(e){return $(e,X)}function re(e){let r=R(e).toLowerCase();for(let t of Ue)if(t.includes(r))return t;return H}function Qe(e){return Be(e)||He(e)||Ve(e)}function O(e,r,t){return We(r)?q(e,r,t):Xe(r)?T(e,r,t):Je(r)?z(e,r,t):Fe(r)?V(e,r,t):Qe(r)?g(e,t.replace(/\\/g,"."),re(r)):ze(r)?Q(e,r,t):Ye(e,r,t)}function Ye(e,r,t){if(!t.startsWith(".")&&!t.startsWith("/"))return null;let n=j(E(e.config.projectRoot,r)),s=P(n,t),o=M(e);for(let i of tt(s)){let a=b(A(e.config.projectRoot,i));if(o.has(a)||w(i))return a}return b(A(e.config.projectRoot,s))}function q(e,r,t){let n=M(e),s;if(t.startsWith(".")){let o=t.match(/^(\.+)(.*)$/);if(!o)return null;let i=o[1].length,a=o[2].replace(/^\./,""),c=j(E(e.config.projectRoot,r));for(let p=1;p<i;p++)c=j(c);s=a?P(c,a.replace(/\./g,"/")):c}else s=P(e.config.projectRoot,t.replace(/\./g,"/"));for(let o of Ge(s)){let i=b(A(e.config.projectRoot,o));if(n.has(i)||w(o))return i}return null}function T(e,r,t){if(!t)return null;let n=t.replace(/\s+as\s+.+$/,"").trim();if(!n.startsWith("crate::")&&!n.startsWith("self::")&&!n.startsWith("super::"))return null;let s=j(E(e.config.projectRoot,r)),o;n.startsWith("crate::")?o=P(e.config.projectRoot,"src",n.slice(7).replace(/::/g,"/")):n.startsWith("self::")?o=P(s,n.slice(6).replace(/::/g,"/")):o=P(j(s),n.slice(7).replace(/::/g,"/"));for(let i of Ke(o)){let a=b(A(e.config.projectRoot,i));if(M(e).has(a)||w(i))return a}return null}function z(e,r,t){let n=j(E(e.config.projectRoot,r)),s=P(n,t);for(let o of Ze(s)){let i=b(A(e.config.projectRoot,o));if(M(e).has(i)||w(o))return i}return null}function V(e,r,t){let n=M(e),s=j(E(e.config.projectRoot,r)),o=[P(s,t),P(e.config.projectRoot,t),P(e.config.projectRoot,"include",t),P(e.config.projectRoot,"src",t)];for(let i of o){let a=b(A(e.config.projectRoot,i));if(n.has(a)||w(i))return a}return null}function g(e,r,t){let n=M(e),s=r.replace(/\\/g,".").replace(/::/g,".").replace(/^global::/,""),o=s.replace(/\./g,"/"),i=s.split(".").pop()??s;for(let c of t){let p=`${o}${c}`,l=[...n].find(u=>u.endsWith(p));if(l)return l}for(let c of t){let p=[...n].find(l=>Le(l)===`${i}${c}`);if(p)return p}let a=[...n].filter(c=>t.includes(R(c).toLowerCase())).filter(c=>c.includes(`/${o}/`)||c.includes(`/${i}/`)).sort((c,p)=>c.localeCompare(p));return a.length===1?a[0]:null}function Q(e,r,t){let n=M(e);if(t.startsWith("package:")){let i=t.slice(8),a=i.indexOf("/");if(a<0)return null;let c=i.slice(a+1),p=b(c.startsWith("lib/")?c:`lib/${c}`);return n.has(p)?p:null}let s=j(E(e.config.projectRoot,r)),o=P(s,t);for(let i of et(o)){let a=b(A(e.config.projectRoot,i));if(n.has(a)||w(i))return a}return null}function Ge(e){let r=R(e);return K.includes(r)?[e]:[`${e}.py`,`${e}.pyi`,E(e,"__init__.py"),E(e,"__init__.pyi")]}function Ke(e){let r=R(e);return Z.includes(r)?[e]:[`${e}.rs`,E(e,"mod.rs")]}function Ze(e){let r=R(e);return ee.includes(r)?[e]:[`${e}.rb`,E(e,"index.rb")]}function et(e){let r=R(e);return te.includes(r)?[e]:[`${e}.dart`,e]}function tt(e){let r=R(e),t=new Set;if(r){t.add(e);for(let n of H)t.add(e.slice(0,-r.length)+n)}else for(let n of H)t.add(`${e}${n}`),t.add(E(e,`index${n}`));return[...t]}function M(e){return qe.get(e,()=>new Set(e.all(`SELECT relative_path
|
|
2
|
-
FROM documents
|
|
3
|
-
WHERE 1 = 1
|
|
4
|
-
${e.pathExclusionsFor("documents")}`).map(r=>b(r.relative_path)).filter(r=>!e.isIgnored(r))))}function b(e){return e.replace(/\\/g,"/")}function me(e){return e.replace(/'''[\s\S]*?'''/g,v).replace(/"""[\s\S]*?"""/g,v).replace(/#.*$/gm,v).replace(/\/\/.*$/gm,v).replace(/\/\*[\s\S]*?\*\//g,v).replace(/`(?:\\[\s\S]|[^`])*`/g,v).replace(/'(?:\\.|[^'\\\r\n])*'/g,v).replace(/"(?:\\.|[^"\\\r\n])*"/g,v)}function v(e){return e.replace(/[^\r\n]/g," ")}var rt=ae("stripped-lines");function er(e,r,t){return rt.get(e,r,t,()=>me(t).split(`
|
|
5
|
-
`))}var ue=null,ne="";function nt(e){return ue===e||(ue=e,ne=me(e)),ne}function x(e,r,t){let n=nt(e);return`${n.slice(0,r)}${" ".repeat(t-r)}${n.slice(t)}`}function y(e,r){return new RegExp(`\\b${de(r)}\\b`,"m").test(e)}function U(e,r){let t=new Set,n=new RegExp(`\\b${de(r)}\\s*\\.\\s*([A-Za-z_$][\\w$]*)`,"g");for(let s of e.matchAll(n)){let o=s[1];o&&t.add(o)}return[...t]}function de(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function I(e){let r=[],t=0,n=0;for(let s=0;s<e.length;s++){let o=e[s];(o==="{"||o==="["||o==="(")&&t++,(o==="}"||o==="]"||o===")")&&t--,o===","&&t===0&&(r.push(e.slice(n,s)),n=s+1)}return r.push(e.slice(n)),r}function _(e,r){for(let t of e.namedChildren)if(t.type===r)return t;return null}function h(e,r){let t=new Set,n=new Set(["identifier","type_identifier","property_identifier","shorthand_property_identifier","field_identifier"]),s=(o,i)=>{let a=i||r.has(o.type);!a&&n.has(o.type)&&t.add(o.text);for(let c of o.children)s(c,a)};return s(e.rootNode,!1),t}function D(e,r,t,n,s,o,i){return{importedName:s,localName:o,sourcePath:i??g(e,n,re(r)),kind:"named",used:y(t,o),usedMembers:[]}}function ge(e,r,t){let n=S(e,r);return n?st(e,r,n):at(t).flatMap(s=>ct(e,r,s.clause,s.specifier,s.start,s.end,t))}function st(e,r,t){let n=h(t,new Set(["import_statement"]));if(ce(r))for(let o of ht(e,r))n.add(o);let s=[];for(let o of t.rootNode.descendantsOfType("import_statement")){let i=ot(o);if(!i)continue;let a=O(e,r,i),c=_(o,"import_clause");if(!c){s.push({importedName:"*",localName:null,sourcePath:a,kind:"side-effect",used:!0,usedMembers:[]});continue}for(let p of c.namedChildren)switch(p.type){case"identifier":{let l=p.text;s.push({importedName:"default",localName:l,sourcePath:a,kind:"default",used:n.has(l),usedMembers:[]});break}case"namespace_import":{let u=_(p,"identifier")?.text??"";if(!u)break;let m=it(t,u);s.push({importedName:"*",localName:u,sourcePath:a,kind:"namespace",used:m.length>0||n.has(u),usedMembers:m});break}case"named_imports":{for(let l of p.namedChildren){if(l.type!=="import_specifier")continue;let u=l.namedChild(0),m=l.namedChild(1);if(!u)continue;let d=u.text,f=m?.text??d;s.push({importedName:d,localName:f,sourcePath:a,kind:"named",used:n.has(f),usedMembers:[]})}break}}}return s}function ot(e){let r=_(e,"string");if(!r)return null;let t=_(r,"string_fragment");return t?t.text:null}function it(e,r){let t=new Set;for(let n of e.rootNode.descendantsOfType("member_expression")){let s=n.namedChild(0),o=n.namedChild(1);!s||!o||s.type!=="identifier"||s.text!==r||(o.type==="property_identifier"||o.type==="identifier")&&t.add(o.text)}return[...t]}function at(e){let r=[],t=/^[ \t]*import\s+([\s\S]*?)\s+from\s+['"]([^'"]+)['"]\s*;?/gm;for(let s of e.matchAll(t)){let o=s[0],i=s[1],a=s[2];!o||!a||typeof s.index!="number"||r.push({clause:i,specifier:a,start:s.index,end:s.index+o.length})}let n=/^[ \t]*import\s+['"]([^'"]+)['"]\s*;?/gm;for(let s of e.matchAll(n)){let o=s[0],i=s[1];!o||!i||typeof s.index!="number"||r.push({clause:null,specifier:i,start:s.index,end:s.index+o.length})}return r.sort((s,o)=>s.start-o.start)}function ct(e,r,t,n,s,o,i){let a=O(e,r,n),c=x(i,s,o);return t?pt(t).map(l=>({...l,sourcePath:a})).map(l=>{if(l.kind==="namespace"){let u=U(c,l.localName);return{...l,used:u.length>0||y(c,l.localName),usedMembers:u}}return l.kind==="side-effect"?{...l,used:!0,usedMembers:[]}:{...l,used:l.localName?y(c,l.localName):!1,usedMembers:[]}}):[{importedName:"*",localName:null,sourcePath:a,kind:"side-effect",used:!0,usedMembers:[]}]}function pt(e){let r=e.trim().replace(/^type\s+/,""),[t,n]=lt(r),s=[];return t&&s.push(...fe(t)),n&&s.push(...fe(n)),s}function fe(e){let r=e.trim();if(!r)return[];if(r.startsWith("{")){let t=r.slice(1,-1).trim();return t?I(t).map(n=>{let s=n.trim().replace(/^type\s+/,""),[o,i]=s.split(/\s+as\s+/);return{importedName:o.trim(),localName:(i??o).trim(),kind:"named"}}):[]}return r.startsWith("* as ")?[{importedName:"*",localName:r.slice(5).trim(),kind:"namespace"}]:[{importedName:"default",localName:r,kind:"default"}]}function lt(e){let r=0;for(let t=0;t<e.length;t++){let n=e[t];if(n==="{"&&r++,n==="}"&&r--,n===","&&r===0)return[e.slice(0,t).trim(),e.slice(t+1).trim()]}return[e.trim(),null]}function he(e,r){let t=S(e,r);if(t)return mt(e,r,t);let n=G(e,r);if(!n)return[];let s=[],o=/^[ \t]*export\s+(?:type\s+)?\{([\s\S]*?)\}\s+from\s+['"]([^'"]+)['"]\s*;?/gm;for(let c of n.matchAll(o)){if(typeof c.index!="number")continue;let p=c[1]??"",l=c[2]??"",u=I(p).map(f=>ut(f.trim())).filter(f=>!!f),m=W(n,c.index),d=W(n,c.index+c[0].length-1);s.push({kind:"named",sourcePath:O(e,r,l),names:u,startLine:m,endLine:d})}let i=/^[ \t]*export\s+\*\s+as\s+(\w+)\s+from\s+['"]([^'"]+)['"]\s*;?/gm;for(let c of n.matchAll(i)){if(typeof c.index!="number")continue;let p=c[2]??"",l=W(n,c.index),u=W(n,c.index+c[0].length-1);s.push({kind:"star-as",sourcePath:O(e,r,p),names:[],startLine:l,endLine:u})}let a=/^[ \t]*export\s+\*\s+from\s+['"]([^'"]+)['"]\s*;?/gm;for(let c of n.matchAll(a)){if(typeof c.index!="number")continue;let p=c[1]??"",l=W(n,c.index),u=W(n,c.index+c[0].length-1);s.push({kind:"star",sourcePath:O(e,r,p),names:[],startLine:l,endLine:u})}return s}function ut(e){if(!e)return null;let r=e.replace(/^type\s+/,"").trim();if(!r)return null;let t=r.match(/^(\w+)\s+as\s+(\w+)$/);if(t)return t[2]??null;let n=r.match(/^(\w+)$/);return n?n[1]??null:null}function W(e,r){let t=0;for(let n=0;n<r&&n<e.length;n++)e.charCodeAt(n)===10&&t++;return t}function mt(e,r,t){let n=[];for(let s of t.rootNode.descendantsOfType("export_statement")){let o=dt(e,r,s);if(o===void 0)continue;let i=s.startPosition.row,a=s.endPosition.row,c=ft(s,o,i,a);n.push(c)}return n}function dt(e,r,t){let n=_(t,"string");if(!n)return;let s=_(n,"string_fragment");if(s)return O(e,r,s.text)}function ft(e,r,t,n){let s=_(e,"export_clause");if(s){let i=[];for(let a of s.namedChildren){if(a.type!=="export_specifier")continue;let c=a.namedChild(0),p=a.namedChild(1);c&&i.push((p??c).text)}return{kind:"named",sourcePath:r,names:i,startLine:t,endLine:n}}return _(e,"namespace_export")?{kind:"star-as",sourcePath:r,names:[],startLine:t,endLine:n}:{kind:"star",sourcePath:r,names:[],startLine:t,endLine:n}}var gt=B("vue-non-script-identifiers");function ht(e,r){return gt.get(e,r,()=>{let t=new Set,n=G(e,r);if(!n)return t;let o=n.replace(/<script\b[^>]*>[\s\S]*?<\/script>/g,i=>i.replace(/[^\r\n]/g," ")).replace(/<!--[\s\S]*?-->/g,i=>i.replace(/[^\r\n]/g," ")).replace(/\/\*[\s\S]*?\*\//g,i=>i.replace(/[^\r\n]/g," "));for(let i of o.matchAll(/[A-Za-z_$][\w$]*/g))t.add(i[0]);return t})}import{basename as Se}from"path";function xe(e,r,t){let n=S(e,r);if(n)return St(e,r,n);let s=[];for(let o of t.matchAll(/^[ \t]*#include\s+[<"]([^">]+)[">]\s*$/gm)){let i=o[1]?.trim(),a=o[0];if(!i||!a||typeof o.index!="number")continue;let c=x(t,o.index,o.index+a.length),p=Se(i).replace(/\.[^.]+$/,"");s.push({importedName:i,localName:p,sourcePath:V(e,r,i),kind:"named",used:y(c,p),usedMembers:[]})}return s}function St(e,r,t){let n=h(t,new Set(["preproc_include"])),s=[];for(let o of t.rootNode.descendantsOfType("preproc_include")){let i=null;for(let c of o.namedChildren){if(c.type==="system_lib_string"){i=c.text.replace(/^<|>$/g,"");break}if(c.type==="string_literal"){i=c.namedChildren.find(l=>l.type==="string_content")?.text??c.text.replace(/^"|"$/g,"");break}}if(!i)continue;let a=Se(i).replace(/\.[^.]+$/,"");s.push({importedName:i,localName:a,sourcePath:V(e,r,i),kind:"named",used:n.has(a),usedMembers:[]})}return s}function ye(e,r,t){let n=[];for(let s of t.matchAll(/^[ \t]*import\s+['"]([^'"]+)['"](?:\s+as\s+([A-Za-z_]\w*))?[\s\S]*?;$/gm)){let o=s[1]?.trim(),i=s[2]?.trim()??null,a=s[0];if(!o||!a||typeof s.index!="number")continue;let c=x(t,s.index,s.index+a.length);n.push({importedName:o,localName:i,sourcePath:Q(e,r,o),kind:i?"namespace":"side-effect",used:i?y(c,i):!0,usedMembers:i?U(c,i):[]})}return n}function Ne(e,r,t){let n=[];for(let s of t.matchAll(/^[ \t]*export\s+['"]([^'"]+)['"][\s\S]*?;$/gm)){let o=s[1]?.trim();o&&n.push({specifier:o,sourcePath:Q(e,r,o)})}return n}function Ie(e,r,t){let n=S(e,r),s=F(r);if(n&&s==="csharp")return yt(e,r,n);if(n&&s==="vb")return xt(e,r,n);let o=[],i=le(r)?/^[ \t]*Imports\s+(.+?)\s*$/gm:/^[ \t]*using\s+(.+?)\s*;$/gm;for(let a of t.matchAll(i)){let c=a[1]?.trim(),p=a[0];if(!c||!p||typeof a.index!="number")continue;let l=x(t,a.index,a.index+p.length),[u,m]=c.split(/\s*=\s*/),d=!!m,f=(d?m:u)?.trim()??c,N=f.split(".").pop()??f,k=d?u?.trim()??N:N;o.push(D(e,r,l,f,N,k,g(e,f,L)))}return o}function xt(e,r,t){let n=h(t,new Set(["imports_statement"])),s=[];for(let o of t.rootNode.descendantsOfType("imports_statement")){let i=o.namedChildren.filter(m=>m.type==="namespace_name");if(i.length===0)continue;let a=i[i.length-1],c=i.length>1?i[0]:null,p=a.text,l=p.split(".").pop()??p,u=c?.text??l;s.push({importedName:l,localName:u,sourcePath:g(e,p,L),kind:c?"namespace":"named",used:n.has(u),usedMembers:[]})}return s}function yt(e,r,t){let n=h(t,new Set(["using_directive"])),s=[];for(let o of t.rootNode.descendantsOfType("using_directive")){let i=o.namedChildren;if(i.length===0)continue;let a=null,c=null;if(i.length>=2&&i[0].type==="identifier"&&(i[1].type==="qualified_name"||i[1].type==="identifier")?(a=i[0],c=i[1]):c=i[i.length-1],!c)continue;let p=c.text,l=p.split(".").pop()??p,u=a?.text??l;s.push({importedName:l,localName:u,sourcePath:g(e,p,L),kind:a?"namespace":"named",used:n.has(u),usedMembers:[]})}return s}function Pe(e,r,t){let n=S(e,r),s=F(r);if(n&&s==="java")return Nt(e,r,n);if(n&&s==="kotlin")return It(e,r,n);if(n&&s==="scala")return Pt(e,r,n);let o=[];for(let i of t.matchAll(/^[ \t]*import\s+(?:static\s+)?(.+?)\s*;?$/gm)){let a=i[1]?.trim(),c=i[0];if(!a||!c||typeof i.index!="number")continue;let p=x(t,i.index,i.index+c.length);o.push(...bt(e,r,a,p))}return o}function Nt(e,r,t){let n=h(t,new Set(["import_declaration"])),s=[];for(let o of t.rootNode.descendantsOfType("import_declaration")){let i=o.children.some(u=>u.type==="asterisk"),c=o.namedChildren.find(u=>u.type==="scoped_identifier")??o.namedChildren.find(u=>u.type==="identifier");if(!c)continue;let p=c.text;if(i){s.push({importedName:"*",localName:null,sourcePath:g(e,p,C),kind:"namespace",used:!0,usedMembers:[]});continue}let l=p.split(".").pop()??p;s.push({importedName:l,localName:l,sourcePath:g(e,p,C),kind:"named",used:n.has(l),usedMembers:[]})}return s}function It(e,r,t){let n=h(t,new Set(["import_header","import_list"])),s=[];for(let o of t.rootNode.descendantsOfType("import_header")){let i=o.namedChildren.find(d=>d.type==="identifier");if(!i)continue;let a=o.namedChildren.some(d=>d.type==="wildcard_import"),c=o.namedChildren.find(d=>d.type==="import_alias");if(a){s.push({importedName:"*",localName:null,sourcePath:g(e,i.text,C),kind:"namespace",used:!0,usedMembers:[]});continue}let p=i.text,l=p.split(".").pop()??p,m=c?.namedChild(0)?.text??l;s.push({importedName:l,localName:m,sourcePath:g(e,p,C),kind:"named",used:n.has(m),usedMembers:[]})}return s}function Pt(e,r,t){let n=h(t,new Set(["import_declaration"])),s=[];for(let o of t.rootNode.descendantsOfType("import_declaration")){let i=o.namedChildren.find(u=>u.type==="namespace_selectors"||u.type==="namespace_wildcard"),a=o.namedChildren.filter(u=>u!==i&&(u.type==="identifier"||u.type==="stable_identifier")),c=a.map(u=>u.text).join(".");if(!c)continue;if(i?.type==="namespace_wildcard"){s.push({importedName:"*",localName:null,sourcePath:g(e,c,C),kind:"namespace",used:!0,usedMembers:[]});continue}if(i?.type==="namespace_selectors"){for(let u of i.namedChildren)if(u.type==="arrow_renamed_identifier"){let[m,d]=u.namedChildren;if(!m)continue;let f=m.text,N=d?.text??f;if(f==="_")continue;s.push({importedName:f,localName:N,sourcePath:g(e,`${c}.${f}`,C),kind:"named",used:n.has(N),usedMembers:[]})}else if(u.type==="identifier"){let m=u.text;s.push({importedName:m,localName:m,sourcePath:g(e,`${c}.${m}`,C),kind:"named",used:n.has(m),usedMembers:[]})}continue}let p=a[a.length-1]?.text??c,l=a.slice(0,-1).map(u=>u.text).join(".")||c;s.push({importedName:p,localName:p,sourcePath:g(e,l&&a.length>1?`${l}.${p}`:c,C),kind:"named",used:n.has(p),usedMembers:[]})}return s}function bt(e,r,t,n){if(t.includes("{")&&t.includes("}")){let s=t.slice(0,t.indexOf("{")).replace(/\.$/,"").trim(),o=t.slice(t.indexOf("{")+1,t.lastIndexOf("}")).trim();return I(o).flatMap(i=>{let a=i.trim();if(!a)return[];let[c,p]=a.includes("=>")?a.split(/\s*=>\s*/):a.split(/\s+as\s+/),l=c?.trim();if(!l||l==="_")return[];let u=(p??l.split(".").pop()??l).trim(),m=l==="_"?s:`${s}.${l}`.replace(/\.\./g,".");return[D(e,r,n,m,l,u)]})}return[D(e,r,n,t,t.split(".").pop()??t,t.split(".").pop()??t)]}function _e(e,r,t){let n=S(e,r);if(n)return _t(e,r,n);let s=[];for(let o of t.matchAll(/^[ \t]*use\s+(.+?)\s*;$/gm)){let i=o[1]?.trim(),a=o[0];if(!i||!a||typeof o.index!="number")continue;let c=x(t,o.index,o.index+a.length);for(let p of I(i)){let l=p.trim();if(!l)continue;let[u,m]=l.split(/\s+as\s+/i),d=u?.trim()??l,f=d.split("\\").pop()??d,N=(m??f).trim();s.push(D(e,r,c,d,f,N,g(e,d.replace(/\\/g,"."),X)))}}return s}function _t(e,r,t){let n=h(t,new Set(["namespace_use_declaration"])),s=[],o=(i,a,c)=>{s.push({importedName:a,localName:c,sourcePath:g(e,i.replace(/\\/g,"."),X),kind:"named",used:n.has(c),usedMembers:[]})};for(let i of t.rootNode.descendantsOfType("namespace_use_declaration")){let a=i.namedChildren.find(c=>c.type==="namespace_use_group");if(a){let c=i.namedChildren.find(p=>p.type==="namespace_name")?.text??"";for(let p of a.namedChildren){if(p.type!=="namespace_use_clause")continue;let{importedName:l,localName:u,qualified:m}=be(p,c);l&&o(m,l,u)}continue}for(let c of i.namedChildren){if(c.type!=="namespace_use_clause")continue;let{importedName:p,localName:l,qualified:u}=be(c,"");p&&o(u,p,l)}}return s}function be(e,r){let t=e.namedChildren.find(p=>p.type==="qualified_name"),n=e.namedChildren.filter(p=>p.type==="name"),s="";t?s=t.text:n.length>=1&&(s=n[0].text);let o=t&&n.length>0?n[n.length-1]:null,i=s.split("\\").pop()??s,a=o?.text??i,c=r?`${r}\\${s}`:s;return{importedName:i,localName:a,qualified:c}}function De(e,r,t){let n=S(e,r);return n?Et(e,r,n):Dt(t).flatMap(s=>Tt(e,r,s,t))}function Et(e,r,t){let n=h(t,new Set(["import_statement","import_from_statement"])),s=[];for(let o of t.rootNode.descendantsOfType("import_statement"))for(let i of o.namedChildren){let a=Ee(i);if(!a)continue;let c=q(e,r,a.qualifiedName);s.push({importedName:a.qualifiedName,localName:a.localName,sourcePath:c,kind:"namespace",used:n.has(a.localName),usedMembers:[]})}for(let o of t.rootNode.descendantsOfType("import_from_statement")){let i=o.namedChild(0);if(!i)continue;let a=Ct(i);if(a===null)continue;let c=q(e,r,a);for(let p=1;p<o.namedChildCount;p+=1){let l=o.namedChild(p);if(l.type==="wildcard_import"){s.push({importedName:"*",localName:null,sourcePath:c,kind:"side-effect",used:!0,usedMembers:[]});continue}let u=Ee(l);u&&s.push({importedName:u.qualifiedName,localName:u.localName,sourcePath:c,kind:"named",used:n.has(u.localName),usedMembers:[]})}}return s}function Ee(e){if(e.type==="aliased_import"){let r=e.namedChild(0),t=e.namedChild(1);return!r||!t?null:{qualifiedName:r.text,localName:t.text}}if(e.type==="dotted_name"){let r=e.text;return{qualifiedName:r,localName:r.split(".")[0]??r}}return e.type==="identifier"?{qualifiedName:e.text,localName:e.text}:null}function Ct(e){if(e.type==="dotted_name")return e.text;if(e.type==="relative_import"){let r=_(e,"import_prefix")?.text??"",t=_(e,"dotted_name")?.text??"";return`${r}${t}`}return null}function Dt(e){let r=e.split(`
|
|
6
|
-
`),t=[],n=0;for(let s=0;s<r.length;s++){let o=r[s],i=o.trimStart(),a=n;if(n+=o.length+1,!i.startsWith("import ")&&!i.startsWith("from "))continue;let c=o,p=a+o.length,l=Ce(o);for(;s+1<r.length&&(l>0||c.trimEnd().endsWith("\\"));){s++;let m=r[s];c+=`
|
|
7
|
-
${m}`,p+=1+m.length,l+=Ce(m),n+=m.length+1}let u=Rt(c);u&&t.push({...u,start:a,end:p})}return t}function Rt(e){let r=e.replace(/\\\s*\n/g," ").trim();if(r.startsWith("import "))return{kind:"import",module:null,clause:r.slice(7).trim()};let t=r.match(/^from\s+([.\w]+)\s+import\s+([\s\S]+)$/);if(!t)return null;let n=t[2].trim();return n.startsWith("(")&&n.endsWith(")")&&(n=n.slice(1,-1).trim()),{kind:"from",module:t[1],clause:n}}function Tt(e,r,t,n){let s=x(n,t.start,t.end),o=t.clause.replace(/\n/g," ").trim();if(t.kind==="import")return I(o).flatMap(c=>{let p=c.trim().replace(/,$/,"");if(!p)return[];let[l,u]=p.split(/\s+as\s+/),m=l.trim(),d=(u??m.split(".")[0]??m).trim(),f=q(e,r,m),N=U(s,d);return[{importedName:m,localName:d,sourcePath:f,kind:"namespace",used:y(s,d)||N.length>0,usedMembers:N}]});let i=t.module?q(e,r,t.module):null,a=[];for(let c of I(o)){let p=c.trim().replace(/,$/,"");if(!p)continue;if(p==="*"){a.push({importedName:"*",localName:null,sourcePath:i,kind:"side-effect",used:!0,usedMembers:[]});continue}let[l,u]=p.split(/\s+as\s+/),m=(u??l).trim();a.push({importedName:l.trim(),localName:m,sourcePath:i,kind:"named",used:y(s,m),usedMembers:[]})}return a}function Ce(e){let r=0;for(let t of e)t==="("&&r++,t===")"&&r--;return r}import{basename as kt}from"path";function Re(e,r,t){let n=S(e,r);if(n)return jt(e,r,n);let s=[];for(let o of t.matchAll(/^[ \t]*(require_relative|require)\s+["']([^"']+)["']\s*$/gm)){let i=o[1],a=o[2],c=o[0];if(!i||!a||!c||typeof o.index!="number")continue;let p=x(t,o.index,o.index+c.length),l=i==="require_relative"?z(e,r,a):null;if(l){let u=Te(a);s.push({importedName:u,localName:u,sourcePath:l,kind:"named",used:y(p,u),usedMembers:[]});continue}s.push({importedName:a,localName:null,sourcePath:l,kind:"side-effect",used:!0,usedMembers:[]})}return s}function jt(e,r,t){let n=h(t,new Set([])),s=[],o=new Set(["require","require_relative","load"]);for(let i of t.rootNode.descendantsOfType("call")){let a=i.namedChild(0);if(!a||a.type!=="identifier"||!o.has(a.text))continue;let p=i.namedChildren.find(d=>d.type==="argument_list")?.namedChild(0);if(!p||p.type!=="string")continue;let u=p.namedChildren.find(d=>d.type==="string_content")?.text;if(!u)continue;let m=a.text==="require_relative"?z(e,r,u):null;if(m){let d=Te(u);s.push({importedName:d,localName:d,sourcePath:m,kind:"named",used:n.has(d),usedMembers:[]})}else s.push({importedName:u,localName:null,sourcePath:m,kind:"side-effect",used:!0,usedMembers:[]})}return s}function Te(e){return kt(e).replace(/\.[^.]+$/,"").split("_").filter(Boolean).map(r=>r.charAt(0).toUpperCase()+r.slice(1)).join("")}function ke(e,r,t){let n=S(e,r);if(n)return $t(e,r,n);let s=[];for(let o of t.matchAll(/^[ \t]*use\s+(.+?)\s*;$/gm)){let i=o[1]?.trim(),a=o[0];if(!i||!a||typeof o.index!="number")continue;let c=x(t,o.index,o.index+a.length);s.push(...vt(e,r,i,c))}return s}function $t(e,r,t){let n=h(t,new Set(["use_declaration"])),s=[];for(let o of t.rootNode.descendantsOfType("use_declaration")){let i=o.namedChild(0);if(i)for(let a of J(i,"")){if(!a.importedName||a.importedName==="*")continue;let c=T(e,r,a.qualifiedName)??T(e,r,a.qualifiedName.split("::").slice(0,-1).join("::"));s.push({importedName:a.importedName,localName:a.localName,sourcePath:c,kind:"named",used:n.has(a.localName),usedMembers:[]})}}return s}function J(e,r){switch(e.type){case"identifier":case"super":case"self":case"crate":{let t=e.text;return[{qualifiedName:Y(r,t),importedName:t,localName:t}]}case"scoped_identifier":{let t=e.text,n=t.split("::").pop()??t;return[{qualifiedName:Y(r,t),importedName:n,localName:n}]}case"scoped_use_list":{let t=e.namedChild(0),n=e.namedChild(1);if(!t||!n)return[];let s=Y(r,t.text),o=[];for(let i of n.namedChildren)o.push(...J(i,s));return o}case"use_list":{let t=[];for(let n of e.namedChildren)t.push(...J(n,r));return t}case"use_as_clause":{let t=e.namedChild(0),n=e.namedChild(1);if(!t||!n)return[];let s=J(t,r),o=n.text;return s.map(i=>({...i,localName:o}))}case"use_wildcard":{let t=e.namedChild(0),n=t?t.text:"";return[{qualifiedName:Y(r,`${n}::*`),importedName:"*",localName:"*"}]}default:return[]}}function Y(e,r){return e?r?`${e}::${r}`:e:r}function vt(e,r,t,n){let s=t.trim();if(s.includes("{")&&s.includes("}")){let l=s.slice(0,s.indexOf("{")).replace(/::$/,"").trim(),u=s.slice(s.indexOf("{")+1,s.lastIndexOf("}")).trim();return I(u).flatMap(m=>{let d=m.trim();if(!d||d==="self")return[];let[f,N]=d.split(/\s+as\s+/),k=f?.trim();if(!k)return[];let Me=(N??k.split("::").pop()??k).trim(),we=`${l}::${k}`.replace(/::::/g,"::");return[D(e,r,n,we,k.split("::").pop()??k,Me,T(e,r,l))]})}let[o,i]=s.split(/\s+as\s+/),a=o?.trim()??s,c=(i??a.split("::").pop()??a).trim(),p=T(e,r,a)??T(e,r,a.split("::").slice(0,-1).join("::"));return[D(e,r,n,a,a.split("::").pop()??a,c,p)]}function je(e,r,t){let n=S(e,r);if(n)return At(e,r,n);let s=[];for(let o of t.matchAll(/^[ \t]*pub\s+use\s+(.+?)\s*;$/gm)){let i=o[1]?.trim();i&&s.push(...Mt(e,r,i))}return s}function At(e,r,t){let n=[];for(let s of t.rootNode.descendantsOfType("use_declaration")){if(!Ot(s))continue;let o=s.namedChildren.find(i=>i.type!=="visibility_modifier");if(o)for(let i of J(o,""))i.importedName&&n.push(se(e,r,i.qualifiedName))}return n}function Ot(e){for(let r of e.children)if(r.type==="visibility_modifier"&&r.text.startsWith("pub"))return!0;return!1}function Mt(e,r,t){let n=t.trim();if(n.includes("{")&&n.includes("}")){let s=n.slice(0,n.indexOf("{")).replace(/::$/,"").trim(),o=n.slice(n.indexOf("{")+1,n.lastIndexOf("}")).trim();return I(o).flatMap(i=>{let a=i.trim();if(!a||a==="self")return[];let[c]=a.split(/\s+as\s+/),p=`${s}::${c?.trim()??a}`.replace(/::::/g,"::");return[se(e,r,p)]})}return[se(e,r,n)]}function se(e,r,t){return{specifier:t,sourcePath:T(e,r,t)??T(e,r,t.split("::").slice(0,-1).join("::"))}}function $e(e,r){let t=r.toLowerCase();for(let n of e)for(let s of n.extensions)if(t.endsWith(s))return n;return null}var wt={language:"javascript",extensions:[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs",".vue"],parseImports:ge},Lt={language:"python",extensions:[".py",".pyi"],parseImports:De},qt={language:"jvm",extensions:[".java",".scala",".kt",".kts"],parseImports:Pe},Ut={language:"rust",extensions:[".rs"],parseImports:ke,parseExports:je},Wt={language:"ruby",extensions:[".rb"],parseImports:Re},Bt={language:"c/cpp",extensions:[".c",".h",".cc",".cpp",".cxx",".hpp",".hh",".hxx"],parseImports:xe},Xt={language:"dotnet",extensions:[".cs",".vb"],parseImports:Ie},Jt={language:"dart",extensions:[".dart"],parseImports:ye,parseExports:Ne},Ft={language:"php",extensions:[".php"],parseImports:_e},Ht=[wt,Lt,qt,Ut,Wt,Bt,Xt,Jt,Ft];function oe(e){return $e(Ht,e)}function Sn(e,r){return he(e,r)}var zt=B("source-imports"),Vt=B("source-exports");function xn(e,r){let t=b(r);return zt.get(e,t,()=>{let n=oe(t);if(!n)return[];let s=Oe(e.config.projectRoot,t);if(!ve(s))return[];let o=Ae(s,"utf-8");return n.parseImports(e,t,o)})}function yn(e,r){let t=b(r);return Vt.get(e,t,()=>{let n=oe(t);if(!n?.parseExports)return[];let s=Oe(e.config.projectRoot,t);if(!ve(s))return[];let o=Ae(s,"utf-8");return n.parseExports(e,t,o)})}export{me as a,er as b,de as c,Sn as d,xn as e,yn as f};
|
|
8
|
-
//# sourceMappingURL=chunk-NKU7Z242.js.map
|
package/dist/chunk-P6IUCZA3.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import{b as g}from"./chunk-5IM4IQ6N.js";import{execFileSync as r}from"child_process";function N(e,a={}){let{base:m="HEAD"}=a,o;try{o=b(e.config.projectRoot,m)}catch{return{changedFiles:[],changedSymbols:[],affectedConsumers:[],summary:{totalChangedFiles:0,totalChangedSymbols:0,totalAffectedFiles:0,note:"Unable to compute git diff."}}}if(o.length===0)return{changedFiles:[],changedSymbols:[],affectedConsumers:[],summary:{totalChangedFiles:0,totalChangedSymbols:0,totalAffectedFiles:0,note:"No changed files found."}};let i=[],n=[];for(let t of o){let s=e.get(`SELECT id, relative_path FROM documents
|
|
2
|
-
WHERE relative_path LIKE ?
|
|
3
|
-
LIMIT 1`,`%${t}`);s&&!e.isIgnored(s.relative_path)&&(i.push(s.relative_path),n.push(s.id))}if(n.length===0)return{changedFiles:o,changedSymbols:[],affectedConsumers:[],summary:{totalChangedFiles:o.length,totalChangedSymbols:0,totalAffectedFiles:0,note:"Changed files are not present in the current SCIP index."}};let u=n.map(()=>"?").join(","),p=e.all(`SELECT DISTINCT gs.id AS symbol_id, gs.symbol, d.relative_path
|
|
4
|
-
FROM mentions m
|
|
5
|
-
JOIN chunks c ON m.chunk_id = c.id
|
|
6
|
-
JOIN global_symbols gs ON m.symbol_id = gs.id
|
|
7
|
-
JOIN documents d ON c.document_id = d.id
|
|
8
|
-
WHERE m.role = 1
|
|
9
|
-
AND c.document_id IN (${u})
|
|
10
|
-
${e.symbolNoiseFor("gs")}
|
|
11
|
-
ORDER BY d.relative_path`,...n),d=[],l=new Map;for(let t of p){let _=e.get(`SELECT COUNT(DISTINCT c.document_id) AS fan_in
|
|
12
|
-
FROM mentions m
|
|
13
|
-
JOIN chunks c ON m.chunk_id = c.id
|
|
14
|
-
WHERE m.symbol_id = ?
|
|
15
|
-
AND m.role != 1`,t.symbol_id)?.fan_in??0,h=g(t.symbol);d.push({symbol:t.symbol,shortName:h,file:t.relative_path,fanIn:_});let y=e.all(`SELECT DISTINCT ref_d.relative_path
|
|
16
|
-
FROM mentions m
|
|
17
|
-
JOIN chunks c ON m.chunk_id = c.id
|
|
18
|
-
JOIN documents ref_d ON c.document_id = ref_d.id
|
|
19
|
-
WHERE m.symbol_id = ?
|
|
20
|
-
AND m.role != 1
|
|
21
|
-
AND ref_d.relative_path NOT IN (${i.map(()=>"?").join(",")})
|
|
22
|
-
${e.pathExclusionsFor("ref_d")}`,t.symbol_id,...i);for(let c of y)e.isIgnored(c.relative_path)||(l.has(c.relative_path)||l.set(c.relative_path,new Set),l.get(c.relative_path).add(h))}let f=[...l.entries()].map(([t,s])=>({file:t,consumedSymbols:s.size})).sort((t,s)=>s.consumedSymbols-t.consumedSymbols);return{changedFiles:i,changedSymbols:d,affectedConsumers:f,summary:{totalChangedFiles:i.length,totalChangedSymbols:d.length,totalAffectedFiles:f.length}}}function b(e,a){let m=r("git",["diff","--name-only",a],{encoding:"utf-8",cwd:e,timeout:1e4}),o=r("git",["diff","--name-only","--cached",a],{encoding:"utf-8",cwd:e,timeout:1e4}),i=r("git",["ls-files","--others","--exclude-standard"],{encoding:"utf-8",cwd:e,timeout:1e4});return[...new Set([m,o,i].flatMap(n=>n.split(`
|
|
23
|
-
`)).map(n=>n.trim()).filter(n=>n.length>0))]}export{N as a};
|
|
24
|
-
//# sourceMappingURL=chunk-P6IUCZA3.js.map
|
package/dist/chunk-PM3GTZ4I.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{q as p}from"./chunk-QL5MJOVA.js";import{a as d,b as f,d as u}from"./chunk-5IM4IQ6N.js";var m={0:"UnspecifiedKind",1:"AbstractMethod",2:"Accessor",3:"Array",4:"Assertion",5:"AssociatedType",6:"Attribute",7:"Axiom",8:"Boolean",9:"Class",10:"Constant",11:"Constructor",12:"Contract",13:"DataFamily",14:"DefinitionMacro",15:"Delegate",16:"Enum",17:"EnumMember",18:"Error",19:"Event",20:"Fact",21:"Field",22:"File",23:"Function",24:"Getter",25:"Grammar",26:"Instance",27:"Interface",28:"Key",29:"Lang",30:"Lemma",31:"Library",32:"Macro",33:"Method",34:"MethodAlias",35:"MethodReceiver",36:"MethodSpecification",37:"Message",38:"Modifier",39:"Module",40:"Namespace",41:"Null",42:"Number",43:"Object",44:"Operator",45:"Package",46:"PackageObject",47:"Parameter",48:"ParameterLabel",49:"Pattern",50:"Predicate",51:"Property",52:"Protocol",53:"ProtocolMethod",54:"PureVirtualMethod",55:"Quasiquoter",56:"SelfParameter",57:"Setter",58:"Signature",59:"SingletonClass",60:"SingletonMethod",61:"StaticDataMember",62:"StaticEvent",63:"StaticField",64:"StaticMethod",65:"StaticProperty",66:"StaticVariable",67:"String",68:"Struct",69:"Subscript",70:"Tactic",71:"Theorem",72:"ThisParameter",73:"Trait",74:"TraitMethod",75:"Type",76:"TypeAlias",77:"TypeClass",78:"TypeClassMethod",79:"TypeFamily",80:"TypeParameter",81:"Union",82:"Value",83:"Variable"},c=new Map;for(let[e,i]of Object.entries(m))c.set(i.toLowerCase(),Number(e));function g(e){let i=parseInt(e,10);if(!isNaN(i))return i;let s=e.toLowerCase(),n=c.get(s);if(n!==void 0)return n;for(let[r,o]of c)if(r.includes(s))return o;return null}function N(e,i,s={}){let{scope:n,limit:r=100}=s,o=g(i);return o===null?[]:b(e,n).map(t=>({row:t,resolvedKind:y(t)})).filter(t=>t.resolvedKind===o).slice(0,r).map(({row:t,resolvedKind:l})=>({symbol:t.symbol,shortName:f(t.symbol),kind:l,kindName:m[l]??"Unknown",relativePath:t.relative_path,startLine:t.start_line,endLine:t.end_line}))}function P(e,i={}){let s=new Map;for(let n of b(e,i.scope)){let r=y(n);r===null||r===0||s.set(r,(s.get(r)??0)+1)}return[...s.entries()].sort((n,r)=>r[1]-n[1]||n[0]-r[0]).map(([n,r])=>({kind:n,kindName:m[n]??"Unknown",count:r}))}function b(e,i){return p(e,{scope:i}).map(S)}function S(e){return{symbol:e.symbol,kind:e.kind,documentation:e.documentation,enclosing_symbol:e.enclosingSymbol,relative_path:e.relativePath,start_line:e.startLine,end_line:e.endLine}}function y(e){return e.kind!==null&&e.kind!==0?h(e.kind,e.symbol,e.documentation):M(e.symbol,e.documentation,e.enclosing_symbol)}function h(e,i,s){let n=(s??"").toLowerCase();if(u(i)==="type"){if(n.includes("type "))return 76;if(n.includes("interface "))return 27;if(n.includes("struct "))return 68;if(n.includes("trait "))return 73;if(n.includes("class "))return 9}return e}function M(e,i,s){let n=d(e);if("kind"in n)return null;let r=n.descriptors,o=r[r.length-2]??null,a=u(e),t=(i??"").toLowerCase();return a==="type"?t.includes("type ")?76:t.includes("interface ")?27:t.includes("struct ")?68:t.includes("trait ")?73:(t.includes("class "),9):a==="method"?o?.suffix==="type"?33:23:a==="namespace"?39:a!=="term"?null:t.includes("async def ")||t.includes("def ")?23:(s?u(s):o?.suffix??null)==="type"?21:83}export{N as a,P as b};
|
|
2
|
-
//# sourceMappingURL=chunk-PM3GTZ4I.js.map
|
package/dist/chunk-QL5MJOVA.js
DELETED
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
import{a as x,b as v,c as k,d as A,f as M}from"./chunk-5IM4IQ6N.js";function b(a){let n=new WeakMap,e=t=>{let r=n.get(t);return r||(r=new Map,n.set(t,r)),r};return{get(t,r,i){let o=e(t);if(o.has(r))return o.get(r);let l=i();return o.set(r,l),l},invalidate(t,r){n.get(t)?.delete(r)},invalidateAll(t){n.delete(t)},size(t){return n.get(t)?.size??0}}}function _e(a){let n=new WeakMap;return{get(e,t){let r=n.get(e);if(r)return r.value;let i=t();return n.set(e,{value:i}),i},invalidate(e){n.delete(e)},has(e){return n.has(e)}}}function I(a){let n=new WeakMap,e=t=>{let r=n.get(t);return r||(r=new Map,n.set(t,r)),r};return{get(t,r,i,o){let l=e(t),s=l.get(r);if(s&&s.source===i)return s.value;let u=o();return l.set(r,{source:i,value:u}),u},invalidate(t,r){n.get(t)?.delete(r)},invalidateAll(t){n.delete(t)}}}import{existsSync as Y,readFileSync as z}from"fs";import{join as K}from"path";var U=b("source-text");function m(a,n){let e=n.replace(/\\/g,"/");return U.get(a,e,()=>{let t=K(a.config.projectRoot,e);return Y(t)?z(t,"utf-8"):""})}var G=/scip-query[\s:-]*ignore[\s:-]*(?:dead(?:-code)?|stale|wrapper|passthrough|drift)?/i;function De(a,n,e){if(e<=0)return!1;let t=m(a,n);if(!t)return!1;let r=t.split(`
|
|
2
|
-
`);for(let i=e-1;i>=0&&i>=e-5;i-=1){let o=(r[i]??"").trim();if(o!==""){if(G.test(o))return!0;if(!o.startsWith("//")&&!o.startsWith("*")&&!o.startsWith("/*")&&!o.startsWith("@")&&!o.startsWith("#"))return!1}}return!1}import{extname as R}from"path";import{createRequire as q}from"module";var p=q(import.meta.url),y=null,N=!1;function P(){if(N)return null;if(y)return y;try{return y=p("tree-sitter"),y}catch{return N=!0,null}}var J={".rs":"rust",".ts":"typescript",".mts":"typescript",".cts":"typescript",".tsx":"tsx",".js":"javascript",".jsx":"javascript",".mjs":"javascript",".cjs":"javascript",".py":"python",".pyi":"python",".java":"java",".kt":"kotlin",".kts":"kotlin",".scala":"scala",".sc":"scala",".rb":"ruby",".c":"c",".h":"c",".cc":"cpp",".cpp":"cpp",".cxx":"cpp",".hpp":"cpp",".hh":"cpp",".hxx":"cpp",".cs":"csharp",".php":"php",".vb":"vb"},w=new Map,S=new Set;function O(a){if(S.has(a))return null;let n=w.get(a);if(n)return n;let e;try{switch(a){case"rust":e=p("tree-sitter-rust");break;case"typescript":e=p("tree-sitter-typescript").typescript;break;case"tsx":e=p("tree-sitter-typescript").tsx;break;case"javascript":e=p("tree-sitter-javascript");break;case"python":e=p("tree-sitter-python");break;case"java":e=p("tree-sitter-java");break;case"kotlin":e=p("tree-sitter-kotlin");break;case"scala":e=p("tree-sitter-scala");break;case"ruby":e=p("tree-sitter-ruby");break;case"c":e=p("tree-sitter-c");break;case"cpp":e=p("tree-sitter-cpp");break;case"csharp":e=p("tree-sitter-c-sharp");break;case"php":e=p("tree-sitter-php").php;break;case"vb":{let t=p("tree-sitter-vb-dotnet");e=t.language??t;break}}}catch{return S.add(a),null}return w.set(a,e),e}var T=new Map;function V(a){let n=T.get(a);if(n)return n;let e=O(a);if(!e)return null;let t=P();if(!t)return null;let r=new t;try{r.setLanguage(e)}catch{return S.add(a),null}return T.set(a,r),r}function h(a){return J[R(a).toLowerCase()]??null}function Z(a){return R(a).toLowerCase()===".vue"}var j=I("ast-trees");function C(a,n){if(Z(n))return X(a,n);let e=h(n);if(!e)return null;let t=m(a,n);return t?j.get(a,n,t,()=>{let r=V(e);if(!r)return null;try{return F(r,t)}catch{return null}}):null}function X(a,n){let e=m(a,n);return e?j.get(a,n,e,()=>{let t=ee(e);if(!t)return null;let r=V(t.language);if(!r)return null;let i=`
|
|
3
|
-
`.repeat(t.startLine)+t.body;try{return F(r,i)}catch{return null}}):null}function F(a,n){return a.parse(t=>t>=n.length?null:n.slice(t,Math.min(n.length,t+16384)))}function ee(a){let n=[],e=/<script\b([^>]*)>([\s\S]*?)<\/script>/g;for(let s of a.matchAll(e))typeof s.index=="number"&&n.push({tagOpen:s[1]??"",body:s[2]??"",openIdx:s.index+(s[0].length-(s[2]?.length??0)-9)});if(n.length===0)return null;let t=n.find(s=>/\bsetup\b/.test(s.tagOpen))??n[0],i=t.tagOpen.match(/\blang\s*=\s*["']?([\w-]+)/)?.[1]?.toLowerCase(),o=i==="ts"||i==="typescript"?"typescript":i==="tsx"?"tsx":"javascript",l=te(a,t.openIdx);return{body:t.body,startLine:l,language:o}}function te(a,n){let e=0;for(let t=0;t<n&&t<a.length;t++)a.charCodeAt(t)===10&&e++;return e}var g=new Map;function ne(a,n){let e=`${a}::${n}`;if(g.has(e))return g.get(e)??null;let t=O(a);if(!t)return g.set(e,null),null;let r=P();if(!r)return g.set(e,null),null;let i=null;try{i=new r.Query(t,n)}catch{i=null}return g.set(e,i),i}var re={rust:`
|
|
4
|
-
(function_item name: (identifier) @name) @def
|
|
5
|
-
(function_signature_item name: (identifier) @name) @def
|
|
6
|
-
`,typescript:`
|
|
7
|
-
(function_declaration name: (identifier) @name) @def
|
|
8
|
-
(method_definition name: (property_identifier) @name) @def
|
|
9
|
-
(method_signature name: (property_identifier) @name) @def
|
|
10
|
-
(function_signature name: (identifier) @name) @def
|
|
11
|
-
(variable_declarator name: (identifier) @name value: (arrow_function)) @def
|
|
12
|
-
(variable_declarator name: (identifier) @name value: (function_expression)) @def
|
|
13
|
-
(public_field_definition name: (property_identifier) @name value: (arrow_function)) @def
|
|
14
|
-
`,tsx:`
|
|
15
|
-
(function_declaration name: (identifier) @name) @def
|
|
16
|
-
(method_definition name: (property_identifier) @name) @def
|
|
17
|
-
(method_signature name: (property_identifier) @name) @def
|
|
18
|
-
(function_signature name: (identifier) @name) @def
|
|
19
|
-
(variable_declarator name: (identifier) @name value: (arrow_function)) @def
|
|
20
|
-
(variable_declarator name: (identifier) @name value: (function_expression)) @def
|
|
21
|
-
(public_field_definition name: (property_identifier) @name value: (arrow_function)) @def
|
|
22
|
-
`,javascript:`
|
|
23
|
-
(function_declaration name: (identifier) @name) @def
|
|
24
|
-
(method_definition name: (property_identifier) @name) @def
|
|
25
|
-
(variable_declarator name: (identifier) @name value: (arrow_function)) @def
|
|
26
|
-
(variable_declarator name: (identifier) @name value: (function_expression)) @def
|
|
27
|
-
`,python:`
|
|
28
|
-
(function_definition name: (identifier) @name) @def
|
|
29
|
-
`},ae=new WeakMap;function Q(a,n){return $(a,n,ae,re,e=>{let t=[];for(let r of e){let i=null,o=null;for(let l of r.captures)l.name==="name"?i=l.node.text:l.name==="def"&&(o={startLine:l.node.startPosition.row,endLine:l.node.endPosition.row});i&&o&&t.push({name:i,startLine:o.startLine,endLine:o.endLine})}return t})}var ie={rust:`
|
|
30
|
-
(call_expression function: (_) @target) @call
|
|
31
|
-
(macro_invocation macro: (_) @target) @call
|
|
32
|
-
`,typescript:`
|
|
33
|
-
(call_expression function: (_) @target) @call
|
|
34
|
-
(new_expression constructor: (_) @target) @call
|
|
35
|
-
`,tsx:`
|
|
36
|
-
(call_expression function: (_) @target) @call
|
|
37
|
-
(new_expression constructor: (_) @target) @call
|
|
38
|
-
`,javascript:`
|
|
39
|
-
(call_expression function: (_) @target) @call
|
|
40
|
-
(new_expression constructor: (_) @target) @call
|
|
41
|
-
`,python:`
|
|
42
|
-
(call function: (_) @target) @call
|
|
43
|
-
`},se=new WeakMap;function Ne(a,n){return $(a,n,se,ie,e=>{let t=[];for(let r of e){let i=null,o=null;for(let s of r.captures)s.name==="target"?i=s.node:s.name==="call"&&(o=s.node);if(!i||!o)continue;let l=L(i);l&&t.push({calleeLeaf:l,line:o.startPosition.row})}return t})}function we(a,n){return oe(a,n,le,()=>new Map,(e,t,r)=>{let i=(s,u)=>{if(s===u)return;let c=r.get(s);c||(c=new Set,r.set(s,c)),c.add(u)},o=t==="python"?new Set(["identifier"]):new Set(["type_identifier"]),l=(s,u)=>{let c=d=>{o.has(d.type)&&d.text!==u&&i(d.text,u);for(let f of d.children)c(f)};for(let d of s.children)c(d)};if(t==="rust")for(let s of e.rootNode.descendantsOfType(["struct_item","enum_item","union_item","type_item"])){let u=s.namedChildren.find(d=>d.type==="type_identifier")?.text;if(!u)continue;let c=s.namedChildren.find(d=>d.type==="field_declaration_list"||d.type==="enum_variant_list"||d.type==="ordered_field_declaration_list");c&&l(c,u),s.type==="type_item"&&l(s,u)}else if(t==="python")for(let s of e.rootNode.descendantsOfType("class_definition")){let u=s.namedChildren.find(d=>d.type==="identifier")?.text;if(!u)continue;let c=s.namedChildren.find(d=>d.type==="block");if(c)for(let d of c.descendantsOfType("type"))for(let f of d.descendantsOfType("identifier"))f.text!==u&&i(f.text,u)}else for(let s of e.rootNode.descendantsOfType(["interface_declaration","type_alias_declaration","class_declaration"])){let u=s.namedChildren.find(c=>c.type==="type_identifier")?.text;u&&l(s,u)}})??new Map}function oe(a,n,e,t,r){let i=h(n);if(!i)return null;let o=C(a,n);if(!o)return null;let l=e.get(o);if(l)return l;let s=t();return r(o,i,s),e.set(o,s),s}function $(a,n,e,t,r){let i=h(n);if(!i)return null;let o=t[i];if(!o)return null;let l=C(a,n);if(!l)return null;let s=e.get(l);if(s)return s;let u=ne(i,o);if(!u)return null;let c=r(u.matches(l.rootNode));return e.set(l,c),c}var le=new WeakMap,E=new WeakMap;function Te(a,n,e,t){let r=h(n);if(!r)return null;let i=C(a,n);if(!i)return null;let o=E.get(i);return o||(o=ce(i,r),E.set(i,o)),o.get(`${e}:${t}`)??null}function ce(a,n){let e=n==="rust"?new Set(["function_item","function_signature_item"]):n==="python"?new Set(["function_definition"]):new Set(["function_declaration","method_definition","arrow_function","function_expression"]),t=new Map,r=i=>{if(e.has(i.type)){let o=i.namedChildren.find(s=>s.type==="parameters"||s.type==="formal_parameters"),l=0;if(o)for(let s of o.namedChildren)s.type==="comment"||s.type==="line_comment"||s.type==="block_comment"||(l+=1);t.set(`${i.startPosition.row}:${i.endPosition.row}`,{paramCount:l})}for(let o of i.children)r(o)};return r(a.rootNode),t}function L(a){switch(a.type){case"identifier":case"type_identifier":case"property_identifier":case"shorthand_property_identifier":return a.text;case"field_expression":case"member_expression":case"attribute":{let n=a.namedChild(a.namedChildCount-1);return n?L(n):null}case"scoped_identifier":{let n=a.childForFieldName("name")??a.namedChild(a.namedChildCount-1);return n?L(n):null}case"super":case"self":case"this":return null;default:return null}}function W(a){return!a||!a.trim()?null:a.replace(/^```\w*\s*/,"").replace(/\s*```$/,"").replace(/^\(method\)\s*/,"").replace(/^\(property\)\s*/,"").replace(/^\(function\)\s*/,"").replace(/^\(class\)\s*/,"").replace(/^\(interface\)\s*/,"").replace(/^\(enum\)\s*/,"").replace(/^\(type alias\)\s*/,"").replace(/^\(const\)\s*/,"").replace(/^\(var\)\s*/,"").trim()||null}function B(a){if(!a)return null;let n=a.indexOf("|");return n===-1?a.replace(/\n/g," "):a.slice(n+1).replace(/\n/g," ")}var ue=b("file-definitions");function D(a,n){return ue.get(a,n,()=>{let e=a.all(`SELECT
|
|
44
|
-
gs.id,
|
|
45
|
-
gs.symbol,
|
|
46
|
-
der.document_id,
|
|
47
|
-
der.start_line,
|
|
48
|
-
der.end_line,
|
|
49
|
-
d.relative_path,
|
|
50
|
-
gs.display_name,
|
|
51
|
-
gs.kind,
|
|
52
|
-
gs.documentation,
|
|
53
|
-
gs.enclosing_symbol
|
|
54
|
-
FROM global_symbols gs
|
|
55
|
-
JOIN defn_enclosing_ranges der ON gs.id = der.symbol_id
|
|
56
|
-
JOIN documents d ON der.document_id = d.id
|
|
57
|
-
WHERE d.relative_path = ?
|
|
58
|
-
${a.symbolNoiseFor("gs")}
|
|
59
|
-
ORDER BY der.start_line, der.end_line`,n),t=e.length>0?[]:a.all(`SELECT
|
|
60
|
-
gs.id,
|
|
61
|
-
gs.symbol,
|
|
62
|
-
c.document_id,
|
|
63
|
-
MIN(c.start_line) AS start_line,
|
|
64
|
-
MAX(c.end_line) AS end_line,
|
|
65
|
-
d.relative_path,
|
|
66
|
-
gs.display_name,
|
|
67
|
-
gs.kind,
|
|
68
|
-
gs.documentation,
|
|
69
|
-
gs.enclosing_symbol
|
|
70
|
-
FROM global_symbols gs
|
|
71
|
-
JOIN mentions m ON m.symbol_id = gs.id
|
|
72
|
-
JOIN chunks c ON m.chunk_id = c.id
|
|
73
|
-
JOIN documents d ON c.document_id = d.id
|
|
74
|
-
WHERE d.relative_path = ?
|
|
75
|
-
AND m.role = 1
|
|
76
|
-
${a.symbolNoiseFor("gs")}
|
|
77
|
-
GROUP BY gs.id, gs.symbol, c.document_id, d.relative_path
|
|
78
|
-
ORDER BY start_line, end_line`,n);return pe(a,n,(e.length>0?e:t).map(r=>({symbolId:r.id,symbol:r.symbol,documentId:r.document_id,startLine:r.start_line,endLine:r.end_line,relativePath:r.relative_path,leaf:k(r.symbol),parentTypeName:he(r.symbol),isFunctionLike:M(r.symbol),isTypeLike:A(r.symbol)==="type",kind:r.kind??null,documentation:r.documentation??null,enclosingSymbol:r.enclosing_symbol??null})))})}function Qe(a,n={}){return de(a,n.scope)}function de(a,n){let e=n?`AND relative_path LIKE '%${n}%'`:"";return a.all(`SELECT relative_path
|
|
79
|
-
FROM documents
|
|
80
|
-
WHERE 1 = 1
|
|
81
|
-
${a.pathExclusionsFor("documents")}
|
|
82
|
-
${e}
|
|
83
|
-
ORDER BY relative_path`).flatMap(t=>D(a,t.relative_path)).filter(t=>!a.isIgnored(t.relativePath))}function $e(a,n,e={}){if(n.length===0)return[];let t=n.flatMap(r=>D(a,r)).filter(r=>!a.isIgnored(r.relativePath));return e.onlyDocumented&&(t=t.filter(r=>r.documentation!==null&&r.documentation!=="")),e.sort&&(t=t.sort((r,i)=>r.relativePath.localeCompare(i.relativePath)||r.startLine-i.startLine||r.endLine-i.endLine)),t.map(r=>({startLine:r.startLine,endLine:r.endLine,symbol:r.symbol,shortName:v(r.symbol),signature:W(B(r.documentation)),relativePath:r.relativePath,enclosingSymbol:r.enclosingSymbol}))}function We(a,n){let e=null;for(let t of a)t.startLine>n||t.endLine<n||(!e||t.endLine-t.startLine<e.endLine-e.startLine)&&(e=t);return e}function Be(a,n){let e=D(a,n.relative_path).find(t=>t.symbolId===n.id);return e?{symbolId:e.symbolId,symbol:e.symbol,documentId:e.documentId,startLine:e.startLine,endLine:e.endLine,relativePath:e.relativePath}:{symbolId:n.id,symbol:n.symbol,documentId:n.document_id,startLine:n.start_line,endLine:n.end_line,relativePath:n.relative_path}}function pe(a,n,e){let t=Q(a,n);if(t)return fe(e,t);let r=m(a,n);if(!r)return e;let i=r.split(/\r?\n/),o=e.some(c=>_(c.symbol))?ge(i):null,l=new Map;for(let c of e)l.set(c.symbolId,me(i,o,c));let s=new Map,u=e.filter(c=>_(c.symbol)).map(c=>({definition:c,startLine:l.get(c.symbolId)??c.startLine})).sort((c,d)=>c.startLine-d.startLine||c.definition.startLine-d.definition.startLine||c.definition.symbol.localeCompare(d.definition.symbol));for(let c=0;c<u.length;c+=1){let d=u[c],f=u[c+1],H=f?Math.max(d.startLine,f.startLine-1):i.length-1;s.set(d.definition.symbolId,{startLine:d.startLine,endLine:be(i,d.definition,d.startLine,H)})}return e.map(c=>{let d=s.get(c.symbolId);return d?{...c,startLine:d.startLine,endLine:d.endLine}:c})}function fe(a,n){let e=new Map;for(let t of n){let r=e.get(t.name);r?r.push(t):e.set(t.name,[t])}return a.map(t=>{if(!_(t.symbol)||!t.leaf)return t;let r=e.get(t.leaf);if(!r||r.length===0)return t;let i=r[0],o=Math.abs(i.startLine-t.startLine);for(let l=1;l<r.length;l+=1){let s=r[l],u=Math.abs(s.startLine-t.startLine);u<o&&(i=s,o=u)}return{...t,startLine:i.startLine,endLine:i.endLine}})}function me(a,n,e){if(!_(e.symbol))return e.startLine;let t=Math.max(0,Math.min(e.startLine,a.length-1));if(!n)return t;let r=n.get(e.leaf);if(!r||r.length===0)return t;let i=null;for(let o of r){let l=Math.abs(o-e.startLine);(!i||l<i.distance)&&(i={line:o,distance:l})}return i?.line??t}function ge(a){let n=/\b(?:function|def|fn)\s+([A-Za-z_$][\w$]*)/g,e=/\b([A-Za-z_$][\w$]*)\s*[:=]\s*(?:async\s*)?(?:function\b|\()/g,t=/^\s*(?:(?:export|public|private|protected|static|readonly|async|abstract|get|set)\s+)*([A-Za-z_$][\w$]*)\s*(?:<[^(]*>)?\s*\(/,r=/\b([A-Za-z_$][\w$]*)\s*\(/g,i=new Map,o=(l,s)=>{let u=i.get(l);if(!u){i.set(l,[s]);return}u[u.length-1]!==s&&u.push(s)};for(let l=0;l<a.length;l+=1){let s=a[l]??"";for(let c of s.matchAll(n))c[1]&&o(c[1],l);for(let c of s.matchAll(e))c[1]&&o(c[1],l);let u=s.match(t);u?.[1]&&o(u[1],l);for(let c of s.matchAll(r))c[1]&&o(c[1],l)}return i}function be(a,n,e,t){let r=Math.max(e,Math.min(a.length-1,t)),i=Math.max(e,Math.min(r,n.endLine)),o=0,l=0,s=!1;for(let u=e;u<=r;u+=1){let c=ye(a[u]??"");for(let d of c)d==="{"?(o+=1,s=!0):d==="}"?o=Math.max(0,o-1):d==="("?l+=1:d===")"&&(l=Math.max(0,l-1));if(s&&o===0||!s&&l===0&&u>=i)return u}return i}function ye(a){let n="",e=null,t=!1;for(let r=0;r<a.length;r+=1){let i=a[r],o=a[r+1];if(!e&&i==="/"&&o==="/"){n+=" ".repeat(a.length-r);break}if(e){if(t){t=!1,n+=" ";continue}if(i==="\\"){t=!0,n+=" ";continue}i===e&&(e=null),n+=" ";continue}if(i==='"'||i==="'"||i==="`"){e=i,n+=" ";continue}n+=i}return n}function _(a){return a.includes("().")}function he(a){let n=x(a);if("kind"in n)return null;for(let e=n.descriptors.length-2;e>=0;e--){let t=n.descriptors[e];if(t?.suffix==="type")return t.name}return null}function He(a){let n=x(a);if("kind"in n)return[];let e=[];for(let t=n.descriptors.length-2;t>=0;t-=1){let r=n.descriptors[t];r?.suffix==="type"&&r.name&&e.push(r.name)}return e}export{b as a,_e as b,I as c,m as d,De as e,h as f,Z as g,C as h,Ne as i,we as j,oe as k,Te as l,L as m,W as n,B as o,D as p,Qe as q,de as r,$e as s,We as t,Be as u,He as v};
|
|
84
|
-
//# sourceMappingURL=chunk-QL5MJOVA.js.map
|
package/dist/chunk-QWFK4QOQ.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{b as p}from"./chunk-4HCKXL7T.js";import{s as u}from"./chunk-QL5MJOVA.js";import{k as f}from"./chunk-5IM4IQ6N.js";function S(a,b){let y=p(a,b),o=u(a,y,{sort:!0});if(o.length===0)return[];let i=o.map(e=>({symbol:e.symbol,shortName:e.shortName,startLine:e.startLine,endLine:e.endLine,children:[]})),s=new Map;for(let e of i)s.set(e.symbol,e);let c=[];for(let e=0;e<o.length;e++){let r=o[e],n=i[e];if(r.enclosingSymbol&&s.has(r.enclosingSymbol)){s.get(r.enclosingSymbol).children.push(n);continue}let l=null,m=1/0;for(let t of i)if(t!==n&&t.startLine<=n.startLine&&t.endLine>=n.endLine){if(t.startLine===n.startLine&&t.endLine===n.endLine&&!f(t.symbol,n.symbol))continue;let d=t.endLine-t.startLine;d<m&&(m=d,l=t)}l?l.children.push(n):c.push(n)}return c}export{S as a};
|
|
2
|
-
//# sourceMappingURL=chunk-QWFK4QOQ.js.map
|
package/dist/chunk-RBYC6PHE.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{k as x}from"./chunk-FT4WPAEX.js";import{e as C,f as S,h as L,r as _}from"./chunk-QL5MJOVA.js";import{b as y,f as d,h as g,i as b}from"./chunk-5IM4IQ6N.js";function P(i,r,a,t){let s=S(r);if(!s)return!0;let n=L(i,r);if(!n)return!0;let l=w.get(n);return l||(l=T(n,s),w.set(n,l)),l.get(`${a}:${t}`)??!0}var w=new WeakMap;function T(i,r){let a=r==="rust"?new Set(["function_item","function_signature_item"]):r==="python"?new Set(["function_definition"]):new Set(["function_declaration","method_definition","arrow_function","function_expression"]),t=new Map,s=n=>{a.has(n.type)&&t.set(`${n.startPosition.row}:${n.endPosition.row}`,N(n,r));for(let l of n.children)s(l)};return s(i.rootNode),t}function N(i,r){let a=i.namedChildren.find(e=>e.type==="block"||e.type==="statement_block");if(!a)return!1;let t=a.namedChildren.filter(e=>e.type!=="comment"&&e.type!=="line_comment"&&e.type!=="block_comment");if(t.length!==1)return!1;let s=t[0],n=null;if(s.type==="return_statement"||s.type==="expression_statement"?n=s.namedChild(0)??null:r==="rust"&&(s.type==="call_expression"||s.type==="macro_invocation")&&(n=s),!n)return!1;let l=r==="python"?"call":"call_expression";if(n.type!==l)return!1;let c=n.namedChildren.find(e=>e.type==="arguments"||e.type==="argument_list");if(!c)return!1;let o=c.namedChildren.filter(e=>e.type!=="comment"),f=i.namedChildren.find(e=>e.type==="parameters"||e.type==="formal_parameters");if(!f)return!1;let p=[];for(let e of f.namedChildren)if(e.type==="identifier")p.push(e.text);else{let m=e.namedChildren.find(u=>u.type==="identifier");m&&p.push(m.text)}if(o.length!==p.length)return!1;for(let e=0;e<p.length;e+=1){let m=o[e];if(m.type!=="identifier"||m.text!==p[e])return!1}return!0}function j(i,r){let{scope:a,maxLoc:t=15,limit:s=30}=r??{},n=D(i,a,t),l=x(i,n),c=[];for(let o of n){if(C(i,o.relativePath,o.startLine))continue;let f=l.get(o.symbolId)??[],p=f.some(u=>d(u.symbol))?f.filter(u=>d(u.symbol)):f,e=new Map;for(let u of p)e.has(u.symbol)||e.set(u.symbol,u);if(e.size!==1||!P(i,o.relativePath,o.startLine,o.endLine))continue;let[,m]=[...e.entries()][0];c.push({symbol:o.symbol,shortName:y(o.symbol),file:o.relativePath,startLine:o.startLine,endLine:o.endLine,loc:h(o),forwardsTo:m.symbol,forwardsToShort:y(m.symbol),forwardsToFile:m.file})}return c.sort((o,f)=>o.loc-f.loc||o.file.localeCompare(f.file)),c.slice(0,s)}function D(i,r,a){return _(i,r).filter(t=>!i.isIgnored(t.relativePath)).filter(t=>d(t.symbol)).filter(t=>!g(t.symbol)).filter(t=>!b(t.symbol)).filter(t=>h(t)>=3&&h(t)<=a)}function h(i){return i.endLine-i.startLine+1}export{j as a};
|
|
2
|
-
//# sourceMappingURL=chunk-RBYC6PHE.js.map
|
package/dist/chunk-TS7E5XBZ.js
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import{b as m}from"./chunk-4HCKXL7T.js";import{p as a}from"./chunk-QL5MJOVA.js";import{b as d,e as l}from"./chunk-5IM4IQ6N.js";function u(t,n){let s=m(t,n);if(s.length===0)return[];let i=s.map(()=>"?").join(", "),c=t.all(`SELECT DISTINCT d1.relative_path, gs.symbol
|
|
2
|
-
FROM mentions m
|
|
3
|
-
JOIN chunks c ON m.chunk_id = c.id
|
|
4
|
-
JOIN documents d1 ON c.document_id = d1.id
|
|
5
|
-
JOIN global_symbols gs ON m.symbol_id = gs.id
|
|
6
|
-
WHERE d1.relative_path NOT IN (${i})
|
|
7
|
-
AND (
|
|
8
|
-
EXISTS (
|
|
9
|
-
SELECT 1
|
|
10
|
-
FROM defn_enclosing_ranges der
|
|
11
|
-
JOIN documents d2 ON der.document_id = d2.id
|
|
12
|
-
WHERE der.symbol_id = gs.id
|
|
13
|
-
AND d2.relative_path IN (${i})
|
|
14
|
-
)
|
|
15
|
-
OR EXISTS (
|
|
16
|
-
SELECT 1
|
|
17
|
-
FROM mentions def_m
|
|
18
|
-
JOIN chunks def_c ON def_m.chunk_id = def_c.id
|
|
19
|
-
JOIN documents d2 ON def_c.document_id = d2.id
|
|
20
|
-
WHERE def_m.symbol_id = gs.id
|
|
21
|
-
AND def_m.role = 1
|
|
22
|
-
AND d2.relative_path IN (${i})
|
|
23
|
-
)
|
|
24
|
-
)
|
|
25
|
-
AND m.role != 1
|
|
26
|
-
AND ${t.localSymbolPredicate}
|
|
27
|
-
${t.pathExclusionsFor("d1")}
|
|
28
|
-
ORDER BY d1.relative_path`,...s,...s,...s),p=s.flatMap(e=>a(t,e).filter(o=>l(o.symbol)).map(o=>({relative_path:e,symbol:o.symbol}))),r=new Set;return[...c,...p].filter(e=>!t.isIgnored(e.relative_path)).filter(e=>{let o=`${e.relative_path}|${e.symbol}`;return r.has(o)?!1:(r.add(o),!0)}).map(e=>({consumer:e.relative_path,symbol:e.symbol,shortName:d(e.symbol)}))}export{u as a};
|
|
29
|
-
//# sourceMappingURL=chunk-TS7E5XBZ.js.map
|
package/dist/chunk-TUC6IWTY.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{i as S,m as M}from"./chunk-FT4WPAEX.js";import{a as g,b as I}from"./chunk-MWCN46ZX.js";import{p as d,t as p}from"./chunk-QL5MJOVA.js";import{b as u}from"./chunk-5IM4IQ6N.js";function N(s,f,n={}){let{maxDepth:a=5,scope:b}=n,c=g(s,f);if(!c)return[];let i=[],y=new Set([c.symbolId]),r=new Set,l=[c];for(let e=1;e<=a&&l.length!==0;e++){let t=[];for(let m of l)for(let o of w(s,m,b)){let h=`${o.file}|${o.shortName}`;if(o.symbolId!==null){if(y.has(o.symbolId))continue;y.add(o.symbolId)}else if(r.has(h))continue;r.add(h),i.push({symbol:o.symbol,shortName:o.shortName,file:o.file,depth:e}),o.symbolId!==null&&o.symbolMatch&&t.push(o.symbolMatch)}l=t}return i.sort((e,t)=>e.depth-t.depth||e.file.localeCompare(t.file)),i}function w(s,f,n){let a=S(s,f,{limit:500}).filter(e=>!s.isIgnored(e.file)).filter(e=>!n||e.file.includes(n)),b=new Set(a.map(e=>e.file)),c=M(s).get(f.symbolId)??new Set,i=[];for(let e of c){if(b.has(e)||s.isIgnored(e)||n&&!e.includes(n))continue;let t=d(s,e),m=t.length>0?p(t,t[0].startLine):null;i.push({symbol:m?.symbol??e,file:e})}let y=[...a,...i],r=[],l=new Set;for(let e of y){let t=I(s,e.symbol);if(!t){let o=`${e.file}|${e.symbol}`;if(l.has(o))continue;l.add(o),r.push({symbolId:null,symbol:e.symbol,shortName:u(e.symbol),file:e.file,symbolMatch:null});continue}if(t.symbolId===f.symbolId||s.isIgnored(t.relativePath))continue;let m=`${t.symbolId}|${t.relativePath}`;l.has(m)||(l.add(m),r.push({symbolId:t.symbolId,symbol:t.symbol,shortName:u(t.symbol),file:t.relativePath,symbolMatch:t}))}return r}export{N as a};
|
|
2
|
-
//# sourceMappingURL=chunk-TUC6IWTY.js.map
|
package/dist/chunk-USMVRM6F.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{d as L}from"./chunk-ZZ3F6P3X.js";import{e as h}from"./chunk-QID23O53.js";import{b as y,k as d,m as b}from"./chunk-FT4WPAEX.js";import{f,r as u}from"./chunk-QL5MJOVA.js";import{b as i,c as m,h as c,i as p}from"./chunk-5IM4IQ6N.js";function x(s,v={}){let{scope:I,minLoc:S=3}=v,o=u(s,I).filter(e=>!s.isIgnored(e.relativePath)).filter(e=>!h(s,e.relativePath)).filter(e=>e.isFunctionLike).filter(e=>!c(e.symbol)).filter(e=>!p(e.symbol)).filter(e=>e.endLine-e.startLine+1>=S),C=b(s,o),M=L(s,o),n=new Set([...C.keys(),...M.keys()]),l=new Map;for(let e of o){let t=m(e.symbol);if(!t)continue;let a=l.get(t)??[];a.push(e.symbolId),l.set(t,a)}let g=s.all(`SELECT relative_path FROM documents WHERE 1 = 1 ${s.pathExclusionsFor("documents")}`);for(let e of g){if(s.isIgnored(e.relative_path)||f(e.relative_path)!=="rust")continue;let t=y(s,e.relative_path);for(let a of t){let r=l.get(a);if(r)for(let F of r)n.add(F)}}let R=new Map(o.map(e=>[e.symbolId,e.symbol])),k=d(s,o,{additive:!0}),E=new Set([...k.entries()].filter(([e,t])=>{let a=R.get(e);return t.some(r=>r.symbol!==a)}).map(([e])=>e));return o.filter(e=>!n.has(e.symbolId)).filter(e=>!E.has(e.symbolId)).sort((e,t)=>t.endLine-t.startLine-(e.endLine-e.startLine)||e.relativePath.localeCompare(t.relativePath)||e.startLine-t.startLine).map(e=>({symbol:e.symbol,shortName:i(e.symbol),relativePath:e.relativePath,startLine:e.startLine,endLine:e.endLine,loc:e.endLine-e.startLine+1}))}export{x as a};
|
|
2
|
-
//# sourceMappingURL=chunk-USMVRM6F.js.map
|
package/dist/chunk-VTZPTRKS.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import{d as x}from"./chunk-ZZ3F6P3X.js";import{a as w}from"./chunk-QID23O53.js";import{f as k,g as P,m as R}from"./chunk-FT4WPAEX.js";import{e as D,p as v,r as _,t as N}from"./chunk-QL5MJOVA.js";import{b as S,c as C,f as M,i as h}from"./chunk-5IM4IQ6N.js";import{basename as p,extname as g}from"path";function Z(e,t){let{scope:i,maxLoc:n=15,limit:s=30}=t??{},o=H(P(e,i)),l=j(e,i,n),c=G(R(e,l),x(e,l)),y=[];for(let r of l){if(D(e,r.relativePath,r.startLine))continue;let b=p(r.relativePath,g(r.relativePath)),L=[...c.get(r.symbolId)??[]].filter(m=>m!==r.relativePath).filter(m=>p(m,g(m))!==b).filter(m=>{let u=w(m);return u!=="barrel"&&u!=="entry"&&u!=="test"});if(L.length!==1)continue;let f=L[0],F=e.get(`SELECT c.start_line, c.end_line
|
|
2
|
-
FROM mentions m
|
|
3
|
-
JOIN chunks c ON m.chunk_id = c.id
|
|
4
|
-
JOIN documents d ON c.document_id = d.id
|
|
5
|
-
WHERE m.symbol_id = ? AND m.role != 1 AND d.relative_path = ?
|
|
6
|
-
LIMIT 1`,r.symbolId,f);if(!F)continue;let O=v(e,f),T=J(e,f,r.symbol,F.start_line,F.end_line),a=N(O,T);if(a&&h(a.symbol))continue;let d,W=a?.symbol??"",A=a?.isFunctionLike?S(a.symbol):p(f);if(a?.isFunctionLike&&a.symbolId!==r.symbolId){let m=[...c.get(a.symbolId)??[]].filter(u=>u!==a.relativePath);d=m.length>0?m.length:E(o,f)}else d=E(o,f);d<=3||y.push({symbol:r.symbol,shortName:S(r.symbol),file:r.relativePath,startLine:r.startLine,endLine:r.endLine,loc:I(r),singleCaller:W,singleCallerShort:A,callerFanIn:d})}return y.sort((r,b)=>b.callerFanIn-r.callerFanIn||b.loc-r.loc),y.slice(0,s)}function I(e){return e.endLine-e.startLine+1}function j(e,t,i){return _(e,t).filter(n=>!e.isIgnored(n.relativePath)).filter(n=>M(n.symbol)).filter(n=>!h(n.symbol)).filter(n=>I(n)<=i&&I(n)>=2)}function J(e,t,i,n,s){let o=C(i);if(!o)return n;let l=k(e,t).get(o);if(!l||l.length===0)return n;for(let c of l)if(c>=n&&c<=s)return c;return n}function G(...e){let t=new Map;for(let i of e)for(let[n,s]of i){let o=t.get(n);o||(o=new Set,t.set(n,o));for(let l of s)o.add(l)}return t}function H(e){let t=new Map;for(let[i,n]of e){t.has(i)||t.set(i,t.get(i)??0);for(let s of n)t.set(s,(t.get(s)??0)+1)}return t}function E(e,t){let i=e.get(t)??0;if(i>0)return i;let n=p(t,g(t)),s=0;for(let[o,l]of e)o!==t&&p(o,g(o))===n&&l>s&&(s=l);return s}export{Z as a};
|
|
7
|
-
//# sourceMappingURL=chunk-VTZPTRKS.js.map
|
package/dist/chunk-WUYKGQSK.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as W}from"./chunk-VTZPTRKS.js";import{b as I}from"./chunk-5NSYCQWM.js";import{a as q}from"./chunk-6U5UHIRD.js";import{a as j}from"./chunk-N3Z2SJCR.js";import{a as B}from"./chunk-USMVRM6F.js";import{a as E}from"./chunk-RBYC6PHE.js";import{a as z}from"./chunk-2DQK2IDZ.js";import{a as V}from"./chunk-G6HYVVRV.js";import{a as A}from"./chunk-4Q2D5BMS.js";import{a as k}from"./chunk-INPQVQ6O.js";import{a as F}from"./chunk-AQFXC7CF.js";import{e as y,f as R}from"./chunk-QID23O53.js";function ht(e,N={}){let{scope:n}=N,c=j(e),T=k(e,{scope:n,minLoc:3,skipBarrels:!0}),w=B(e,{scope:n,minLoc:3}),P=A(e,{scope:n}),U=I(e,{scope:n,minSimilarity:.6,limit:50,minCallees:4}),m=V(e,{scope:n,minLoc:15,minCallees:5,limit:50}),l=W(e,{scope:n,maxLoc:15,limit:50}),a=E(e,{scope:n,maxLoc:15,limit:50}),x=q(e,{scope:n,minLoc:3,limit:50}),s=z(e,{scope:n}),C=F(e,{scope:n,minLoc:10,limit:10}),S=T.symbols.filter(t=>!y(e,t.relativePath)&&!R(e,t.symbol,t.relativePath)&&t.kind==="dead-code"),u=S.length,$=S.reduce((t,o)=>t+o.loc,0),h=w.filter(t=>!y(e,t.relativePath)&&!R(e,t.symbol,t.relativePath)).length,p=x.length,v=s.unusedImports+s.layerViolations,d=U.length,r=[];u>0&&r.push({category:"Dead code",description:`${u} symbols with zero references anywhere \u2014 safe to delete`,effort:"low",impact:"high",count:u,locRecoverable:$}),h>0&&r.push({category:"Isolated symbols",description:`${h} symbols completely disconnected from the codebase graph`,effort:"low",impact:"medium",count:h,locRecoverable:w.filter(t=>!y(e,t.relativePath)&&!R(e,t.symbol,t.relativePath)).reduce((t,o)=>t+o.loc,0)});let b=P.filter(t=>t.kind==="real");if(b.length>0&&r.push({category:"Circular dependencies",description:`${b.length} cycle(s) \u2014 break with dependency inversion or module restructuring`,effort:"medium",impact:"high",count:b.length,locRecoverable:0}),d>0&&r.push({category:"Similar functions",description:`${d} pairs with real logic overlap (beyond shared imports) \u2014 consolidation candidates`,effort:"medium",impact:"medium",count:d,locRecoverable:0}),m.length>0&&r.push({category:"Extraction candidates",description:`${m.length} large functions with isolated callee clusters \u2014 extract method opportunities`,effort:"medium",impact:"medium",count:m.length,locRecoverable:0}),l.length>0&&r.push({category:"Wrapper functions",description:`${l.length} single-consumer symbols that could be inlined`,effort:"low",impact:"low",count:l.length,locRecoverable:l.reduce((t,o)=>t+o.loc,0)}),a.length>0&&r.push({category:"Passthrough functions",description:`${a.length} functions that just forward to one callee \u2014 unnecessary indirection`,effort:"low",impact:"low",count:a.length,locRecoverable:a.reduce((t,o)=>t+o.loc,0)}),p>0){let t=x.filter(M=>M.consumers===0).length,o=p-t,g=[];t>0&&g.push(`${t} unused`),o>0&&g.push(`${o} single-consumer (not in types file)`),r.push({category:"Stale abstractions",description:`${g.join(", ")} \u2014 premature abstraction`,effort:"low",impact:"medium",count:p,locRecoverable:x.reduce((M,_)=>M+_.loc,0)})}if(v>0||s.patternDeviations>0){let t=[];s.unusedImports>0&&t.push(`${s.unusedImports} unused imports`),s.layerViolations>0&&t.push(`${s.layerViolations} layer violations`),s.patternDeviations>0&&t.push(`${s.patternDeviations} unique deps`),r.push({category:"Structural drift",description:t.join(", "),effort:s.layerViolations>0?"medium":"low",impact:s.layerViolations>0?"medium":"low",count:v,locRecoverable:0})}let D={high:3,medium:2,low:1},L={low:3,medium:2,high:1};r.sort((t,o)=>{let g=D[t.impact]*L[t.effort];return D[o.impact]*L[o.effort]-g});let G=Math.max(c.documents,1),f=Math.max(c.symbols,1),i=100,J=u/f;i-=Math.min(20,Math.round(J*200));let K=h/f;i-=Math.min(10,Math.round(K*200));let H=P.filter(t=>t.kind==="real").length;i-=Math.min(15,H*5);let O=d/f*1e3;i-=Math.min(10,Math.round(O));let Q=m.length/f*1e3;i-=Math.min(5,Math.round(Q/2)),i-=Math.min(3,l.length),i-=Math.min(3,a.length);let X=p/Math.max(f*.1,1);i-=Math.min(8,Math.round(X*10));let Y=v/G;i-=Math.min(5,Math.round(Y*50));let Z=C.filter(t=>t.score>50).length;return i-=Math.min(5,Z*2),i=Math.max(0,Math.min(100,i)),{score:i,overview:{documents:c.documents,symbols:c.symbols,indexSizeBytes:c.indexSizeBytes},findings:{deadSymbols:u,deadLoc:$,isolatedSymbols:h,isolatedLoc:w.filter(t=>!y(e,t.relativePath)).reduce((t,o)=>t+o.loc,0),cycles:H,similarPairs:d,extractionCandidates:m.length,wrappers:l.length,passthroughs:a.length,staleTypes:p,driftedFiles:v,complexityHotspotCount:C.length},actions:r,topComplexity:C.slice(0,5).map(t=>({symbol:t.shortName,score:t.score}))}}export{ht as a};
|
|
2
|
-
//# sourceMappingURL=chunk-WUYKGQSK.js.map
|
package/dist/chunk-X7LOLGYY.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{h as n,i as a}from"./chunk-FT4WPAEX.js";import{a as i}from"./chunk-MWCN46ZX.js";import{b as m}from"./chunk-5IM4IQ6N.js";function b(s,e){let o=i(s,e);if(!o)return null;let t=a(s,o,{limit:50}),r=y(n(s,o,{limit:50}));return{symbol:o.symbol,shortName:m(o.symbol),callers:t.map(l=>({symbol:l.symbol,shortName:m(l.symbol),file:l.file})),callees:r.map(l=>({symbol:l.symbol,shortName:m(l.symbol),file:l.file}))}}function y(s){let e=new Set,o=[];for(let t of s){let r=`${t.symbol}|${t.file}`;e.has(r)||(e.add(r),o.push(t))}return o}export{b as a};
|
|
2
|
-
//# sourceMappingURL=chunk-X7LOLGYY.js.map
|
package/dist/chunk-XGOEZVMA.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import{k as g}from"./chunk-FT4WPAEX.js";import{a as b}from"./chunk-MWCN46ZX.js";import{b as m}from"./chunk-5IM4IQ6N.js";import{readFileSync as y}from"fs";import{join as d}from"path";function I(o,i){let t=b(o,i);if(!t)return null;let l=o.get("SELECT language FROM documents WHERE relative_path = ?",t.relativePath)?.language??"unknown",s=d(o.config.projectRoot,t.relativePath),n="";try{n=y(s,"utf-8").split(`
|
|
2
|
-
`).slice(t.startLine,t.endLine+1).join(`
|
|
3
|
-
`)}catch{}let e=S(n,l),f=t.endLine-t.startLine+1,a=g(o,[t],{additive:!0}).get(t.symbolId)??[],p=new Set(a.map(r=>r.symbol)),u=o.get(`SELECT COUNT(DISTINCT c.document_id) AS c
|
|
4
|
-
FROM mentions m
|
|
5
|
-
JOIN chunks c ON m.chunk_id = c.id
|
|
6
|
-
WHERE m.symbol_id = ? AND m.role != 1`,t.symbolId),h=new Set(a.filter(r=>r.file!==t.relativePath).map(r=>r.symbol)).size;return{symbol:t.symbol,shortName:m(t.symbol),relativePath:t.relativePath,startLine:t.startLine,endLine:t.endLine,loc:f,branches:e,cyclomaticEstimate:e+1,calleeCount:p.size,fanIn:u?.c??0,fanOut:h}}function S(o,i){let t=P(o),c=0,l=[/\bif\b/g,/\belse\s+if\b/g,/\belse\b/g,/\bfor\b/g,/\bwhile\b/g,/\bswitch\b/g,/\bcase\b/g,/\bcatch\b/g,/\?\s*[^?]/g,/&&/g,/\|\|/g];for(let s of l){let n=t.match(s);n&&(c+=n.length)}if(i==="python"){let s=[/\belif\b/g,/\bexcept\b/g,/\bfinally\b/g];for(let n of s){let e=t.match(n);e&&(c+=e.length)}}else if(i==="rust"){let s=[/\bmatch\b/g,/=>/g,/\bloop\b/g];for(let n of s){let e=t.match(n);e&&(c+=e.length)}}else if(i==="ruby"){let s=[/\belsif\b/g,/\bunless\b/g,/\brescue\b/g,/\bwhen\b/g];for(let n of s){let e=t.match(n);e&&(c+=e.length)}}else if(i==="go"){let s=[/\bselect\b/g,/\bdefer\b/g];for(let n of s){let e=t.match(n);e&&(c+=e.length)}}return c}function P(o){return o.replace(/\/\*[\s\S]*?\*\//g,"").replace(/\/\/.*/g,"").replace(/#.*/g,"").replace(/"(?:[^"\\]|\\.)*"/g,'""').replace(/'(?:[^'\\]|\\.)*'/g,"''").replace(/`(?:[^`\\]|\\.)*`/g,"``")}export{I as a};
|
|
7
|
-
//# sourceMappingURL=chunk-XGOEZVMA.js.map
|
package/dist/chunk-Y6NOLG4X.js
DELETED
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import{c as E}from"./chunk-QID23O53.js";import{e as h,f as _}from"./chunk-NKU7Z242.js";import{p as b}from"./chunk-QL5MJOVA.js";import{b as m,d as p}from"./chunk-5IM4IQ6N.js";function C(e,s={}){let{scope:n,limit:i}=s,l=n?`AND barrel_d.relative_path LIKE '%${n}%'`:"",o=e.all(`SELECT DISTINCT
|
|
2
|
-
barrel_d.id AS barrel_doc_id,
|
|
3
|
-
barrel_d.relative_path AS barrel_path,
|
|
4
|
-
gs.id AS symbol_id,
|
|
5
|
-
gs.symbol AS symbol,
|
|
6
|
-
orig_d.id AS original_doc_id,
|
|
7
|
-
orig_d.relative_path AS original_path
|
|
8
|
-
FROM mentions m
|
|
9
|
-
JOIN chunks c ON m.chunk_id = c.id
|
|
10
|
-
JOIN documents barrel_d ON c.document_id = barrel_d.id
|
|
11
|
-
JOIN global_symbols gs ON m.symbol_id = gs.id
|
|
12
|
-
JOIN (
|
|
13
|
-
SELECT m2.symbol_id, c2.document_id
|
|
14
|
-
FROM mentions m2
|
|
15
|
-
JOIN chunks c2 ON m2.chunk_id = c2.id
|
|
16
|
-
WHERE m2.role = 1
|
|
17
|
-
GROUP BY m2.symbol_id
|
|
18
|
-
) sym_def ON sym_def.symbol_id = gs.id
|
|
19
|
-
JOIN documents orig_d ON sym_def.document_id = orig_d.id
|
|
20
|
-
WHERE m.role != 1
|
|
21
|
-
AND (barrel_d.relative_path LIKE '%/index.ts'
|
|
22
|
-
OR barrel_d.relative_path LIKE '%/index.js'
|
|
23
|
-
OR barrel_d.relative_path = 'index.ts'
|
|
24
|
-
OR barrel_d.relative_path = 'index.js')
|
|
25
|
-
AND orig_d.id != barrel_d.id
|
|
26
|
-
${e.pathExclusionsFor("barrel_d","orig_d")}
|
|
27
|
-
${e.symbolNoiseFor("gs")}
|
|
28
|
-
-- Only function-level symbols (ending with ().), not module-level
|
|
29
|
-
AND gs.symbol LIKE '%().'
|
|
30
|
-
${l}
|
|
31
|
-
ORDER BY barrel_d.relative_path, gs.symbol`),a=[];for(let r of o){if(e.isIgnored(r.barrel_path)||e.isIgnored(r.original_path)||E(e,r.barrel_path))continue;let t=e.get(`SELECT
|
|
32
|
-
SUM(CASE WHEN uses_barrel = 1 THEN 1 ELSE 0 END) AS barrel_consumers,
|
|
33
|
-
SUM(CASE WHEN uses_barrel = 0 THEN 1 ELSE 0 END) AS direct_consumers
|
|
34
|
-
FROM (
|
|
35
|
-
SELECT
|
|
36
|
-
consumer_d.id AS consumer_doc_id,
|
|
37
|
-
MAX(CASE WHEN EXISTS (
|
|
38
|
-
SELECT 1
|
|
39
|
-
FROM mentions barrel_m
|
|
40
|
-
JOIN chunks barrel_c ON barrel_m.chunk_id = barrel_c.id
|
|
41
|
-
WHERE barrel_c.document_id = consumer_d.id
|
|
42
|
-
AND barrel_m.role != 1
|
|
43
|
-
AND barrel_m.symbol_id IN (
|
|
44
|
-
SELECT m2.symbol_id
|
|
45
|
-
FROM mentions m2
|
|
46
|
-
JOIN chunks c2 ON m2.chunk_id = c2.id
|
|
47
|
-
WHERE c2.document_id = ?
|
|
48
|
-
AND m2.role != 1
|
|
49
|
-
)
|
|
50
|
-
) THEN 1 ELSE 0 END) AS uses_barrel
|
|
51
|
-
FROM mentions ref_m
|
|
52
|
-
JOIN chunks ref_c ON ref_m.chunk_id = ref_c.id
|
|
53
|
-
JOIN documents consumer_d ON ref_c.document_id = consumer_d.id
|
|
54
|
-
WHERE ref_m.symbol_id = ?
|
|
55
|
-
AND ref_m.role != 1
|
|
56
|
-
AND consumer_d.id != ?
|
|
57
|
-
AND consumer_d.id != ?
|
|
58
|
-
${e.pathExclusionsFor("consumer_d")}
|
|
59
|
-
GROUP BY consumer_d.id
|
|
60
|
-
)`,r.barrel_doc_id,r.symbol_id,r.barrel_doc_id,r.original_doc_id),c=t?.barrel_consumers??0,u=t?.direct_consumers??0;c===0&&u===0&&a.push({barrelFile:r.barrel_path,symbol:r.symbol,shortName:m(r.symbol),originalFile:r.original_path,barrelConsumers:c,directConsumers:u})}a.sort((r,t)=>t.directConsumers-r.directConsumers||r.barrelFile.localeCompare(t.barrelFile)||r.shortName.localeCompare(t.shortName));let d=R([...a,...g(e,n)]);return d.sort((r,t)=>t.directConsumers-r.directConsumers||r.barrelFile.localeCompare(t.barrelFile)||r.shortName.localeCompare(t.shortName)),i?d.slice(0,i):d}function g(e,s){let i=e.all(`SELECT relative_path
|
|
61
|
-
FROM documents
|
|
62
|
-
WHERE 1 = 1
|
|
63
|
-
${s?"AND relative_path LIKE ?":""}
|
|
64
|
-
${e.pathExclusionsFor("documents")}
|
|
65
|
-
ORDER BY relative_path`,...s?[`%${s}%`]:[]).map(o=>o.relative_path).filter(o=>!e.isIgnored(o)).filter(o=>_(e,o).length>0),l=[];for(let o of i){let a=_(e,o).filter(r=>r.sourcePath&&!e.isIgnored(r.sourcePath));if(!(a.length===0||f(e,o,o)>0))for(let r of a){let t=r.sourcePath,c=N(e,t);c&&l.push({barrelFile:o,symbol:c.symbol,shortName:m(c.symbol),originalFile:t,barrelConsumers:0,directConsumers:f(e,t,o)})}}return l}function f(e,s,n){let i=e.all(`SELECT relative_path
|
|
66
|
-
FROM documents
|
|
67
|
-
WHERE 1 = 1
|
|
68
|
-
${e.pathExclusionsFor("documents")}
|
|
69
|
-
ORDER BY relative_path`),l=new Set;for(let o of i)if(!(e.isIgnored(o.relative_path)||o.relative_path===n))for(let a of h(e,o.relative_path))a.sourcePath===s&&l.add(o.relative_path);return l.size}function N(e,s){let n=b(e,s);return n.find(i=>p(i.symbol)==="method")??n[0]??null}function R(e){let s=new Set,n=[];for(let i of e){let l=`${i.barrelFile}|${i.symbol}|${i.originalFile}`;s.has(l)||(s.add(l),n.push(i))}return n}export{C as a};
|
|
70
|
-
//# sourceMappingURL=chunk-Y6NOLG4X.js.map
|
package/dist/chunk-YVQ7CIKO.js
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import{a as f}from"./chunk-4HCKXL7T.js";import{a as p}from"./chunk-MWCN46ZX.js";import{b as g}from"./chunk-5IM4IQ6N.js";import{readFileSync as v}from"fs";import{join as d}from"path";function _(e,u,l={}){let{context:a=0}=l,r=u.match(/^(.+\.\w+):(\d+)-(\d+)$/);if(r)return y(e,r[1],parseInt(r[2],10),parseInt(r[3],10),a);let t=p(e,u);if(!t)return null;let n=e.get("SELECT language FROM documents WHERE relative_path = ?",t.relativePath),m=d(e.config.projectRoot,t.relativePath),o;try{o=v(m,"utf-8")}catch{return null}let i=o.split(`
|
|
2
|
-
`),s=Math.max(0,t.startLine-a),c=Math.min(i.length-1,t.endLine+a),h=i.slice(s,c+1).join(`
|
|
3
|
-
`);return{symbol:t.symbol,shortName:g(t.symbol),relativePath:t.relativePath,startLine:s,endLine:c,language:n?.language??null,source:h}}function y(e,u,l,a,r){let t=f(e,u);if(!t)return null;let n=e.get("SELECT relative_path, language FROM documents WHERE relative_path = ?",t);if(!n)return null;let m=d(e.config.projectRoot,n.relative_path),o;try{o=v(m,"utf-8")}catch{return null}let i=o.split(`
|
|
4
|
-
`),s=Math.max(0,l-1-r),c=Math.min(i.length-1,a-1+r),h=i.slice(s,c+1).join(`
|
|
5
|
-
`);return{symbol:`${n.relative_path}:${l}-${a}`,shortName:`${n.relative_path}:${l}-${a}`,relativePath:n.relative_path,startLine:s,endLine:c,language:n.language,source:h}}export{_ as a};
|
|
6
|
-
//# sourceMappingURL=chunk-YVQ7CIKO.js.map
|
package/dist/chunk-ZIFKQQW2.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{c as S}from"./chunk-ZZ3F6P3X.js";import{j as d}from"./chunk-FT4WPAEX.js";import{a as g}from"./chunk-MWCN46ZX.js";import{d as u,n as m,o as f}from"./chunk-QL5MJOVA.js";import{b as s,f as a}from"./chunk-5IM4IQ6N.js";function _(n,o){let e=g(n,o);if(!e)return{definitions:[],referencedBy:[]};let i=n.get("SELECT display_name, documentation FROM global_symbols WHERE id = ?",e.symbolId),t=f(i?.documentation??null),c=n.isIgnored(e.relativePath)?[]:[{relativePath:e.relativePath,startLine:e.startLine,endLine:e.endLine,signature:b(t,i?.display_name??null,e.symbol),source:y(n,e.relativePath,e.startLine,e.endLine)}],l=S(n,e),p=(l.length>0?l:d(n,e)).filter(r=>!n.isIgnored(r.file)).map(r=>({relativePath:r.file,line:r.line,enclosingSymbol:r.enclosingSymbol,enclosingShort:r.enclosingSymbol?s(r.enclosingSymbol):"(top-level)"}));return{definitions:c,referencedBy:p}}function y(n,o,e,i){let t=u(n,o);if(!t)return null;let l=t.split(`
|
|
2
|
-
`).slice(e,i+1).join(`
|
|
3
|
-
`).trimEnd();return l.length>0?l:null}function b(n,o,e){let i=m(n);if(i&&!h(i))return i;let t=(o??"").trim();return t?a(e)&&!t.endsWith("()")?`${t}()`:t:s(e)}function h(n){return n.startsWith("undefined")||n.includes("|")||n.includes("```")}export{_ as a};
|
|
4
|
-
//# sourceMappingURL=chunk-ZIFKQQW2.js.map
|
package/dist/chunk-ZOR6FW74.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{c as g}from"./chunk-ZZ3F6P3X.js";import{h as u,j as h}from"./chunk-FT4WPAEX.js";import{a as d,b as y}from"./chunk-MWCN46ZX.js";import{p as S,t as p}from"./chunk-QL5MJOVA.js";import{b as m}from"./chunk-5IM4IQ6N.js";function N(e,o,r={}){let{direction:c="backward",maxDepth:s=3}=r,t=d(e,o);return t?c==="backward"?w(e,t,s):R(e,t):null}function w(e,o,r){let c=[],s=new Set([o.symbol]),t=[o];for(let n=1;n<=r&&t.length!==0;n++){let l=[];for(let a of t){let i=u(e,a);for(let f of i){if(s.has(f.symbol))continue;s.add(f.symbol),c.push({symbol:f.symbol,shortName:m(f.symbol),file:f.file,relationship:n===1?"referenced within definition (callee)":`depth ${n} callee`});let b=y(e,f.symbol);b&&!e.isIgnored(b.relativePath)&&l.push(b)}}t=l}return{symbol:o.symbol,shortName:m(o.symbol),direction:"backward",connectedSymbols:c}}function R(e,o){let r=g(e,o),c=r.length>0?r:h(e,o),s=new Set,t=[];for(let n of c){if(t.length>=30)break;if(e.isIgnored(n.file))continue;let l=n.enclosingSymbol??p(S(e,n.file),n.line)?.symbol??null;if(!l||l===o.symbol)continue;let a=y(e,l);if(a){for(let i of u(e,a))if(i.symbol!==o.symbol&&i.symbol!==l&&i.file!==n.file&&!e.isIgnored(i.file)&&!s.has(i.symbol)&&(s.add(i.symbol),t.push({symbol:i.symbol,shortName:m(i.symbol),file:i.file,relationship:`used alongside target in ${m(l)}`}),t.length>=30))break}}return t.sort((n,l)=>n.file.localeCompare(l.file)),{symbol:o.symbol,shortName:m(o.symbol),direction:"forward",connectedSymbols:t}}export{N as a};
|
|
2
|
-
//# sourceMappingURL=chunk-ZOR6FW74.js.map
|
package/dist/chunk-ZPZLVFJQ.js
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import{h as a,i as c}from"./chunk-FT4WPAEX.js";import{q as d}from"./chunk-QL5MJOVA.js";import{b as l}from"./chunk-5IM4IQ6N.js";function E(e,t={}){let{limit:m=20,scope:s,minFanIn:n=2,minFanOut:f=2}=t,_=s?`AND def_d.relative_path LIKE '%${s}%'`:"",r=e.all(`SELECT * FROM (
|
|
2
|
-
SELECT
|
|
3
|
-
gs.symbol,
|
|
4
|
-
def_d.relative_path AS defined_in,
|
|
5
|
-
(SELECT COUNT(DISTINCT ref_c.document_id)
|
|
6
|
-
FROM mentions ref_m
|
|
7
|
-
JOIN chunks ref_c ON ref_m.chunk_id = ref_c.id
|
|
8
|
-
WHERE ref_m.symbol_id = gs.id AND ref_m.role != 1
|
|
9
|
-
) AS fan_in,
|
|
10
|
-
(SELECT COUNT(DISTINCT ref_gs.id)
|
|
11
|
-
FROM mentions ref_m
|
|
12
|
-
JOIN chunks ref_c ON ref_m.chunk_id = ref_c.id
|
|
13
|
-
JOIN global_symbols ref_gs ON ref_m.symbol_id = ref_gs.id
|
|
14
|
-
JOIN (
|
|
15
|
-
SELECT m3.symbol_id, c3.document_id
|
|
16
|
-
FROM mentions m3
|
|
17
|
-
JOIN chunks c3 ON m3.chunk_id = c3.id
|
|
18
|
-
WHERE m3.role = 1
|
|
19
|
-
GROUP BY m3.symbol_id
|
|
20
|
-
) ref_sym_def ON ref_sym_def.symbol_id = ref_gs.id
|
|
21
|
-
WHERE ref_c.document_id = def_d.id
|
|
22
|
-
AND ref_m.role != 1
|
|
23
|
-
AND ref_sym_def.document_id != def_d.id
|
|
24
|
-
) AS fan_out
|
|
25
|
-
FROM global_symbols gs
|
|
26
|
-
JOIN (
|
|
27
|
-
SELECT m2.symbol_id, c2.document_id
|
|
28
|
-
FROM mentions m2
|
|
29
|
-
JOIN chunks c2 ON m2.chunk_id = c2.id
|
|
30
|
-
WHERE m2.role = 1
|
|
31
|
-
GROUP BY m2.symbol_id
|
|
32
|
-
) sym_def ON sym_def.symbol_id = gs.id
|
|
33
|
-
JOIN documents def_d ON sym_def.document_id = def_d.id
|
|
34
|
-
WHERE 1 = 1
|
|
35
|
-
${e.pathExclusionsFor("def_d")}
|
|
36
|
-
${e.symbolNoiseFor("gs")}
|
|
37
|
-
${_}
|
|
38
|
-
) WHERE fan_in >= ? AND fan_out >= ?
|
|
39
|
-
ORDER BY (fan_in * fan_out) DESC
|
|
40
|
-
LIMIT ?`,n,f,m).filter(o=>!e.isIgnored(o.defined_in)).map(o=>({symbol:o.symbol,shortName:l(o.symbol),fanIn:o.fan_in,fanOut:o.fan_out,score:o.fan_in*o.fan_out,definedIn:o.defined_in}));return r.length>0?r:u(e,s,{minFanIn:n,minFanOut:f,limit:m})}function u(e,t,m){let{minFanIn:s,minFanOut:n,limit:f}=m;return d(e,{scope:t}).filter(i=>!e.isIgnored(i.relativePath)).map(i=>b(e,i)).filter(i=>i.fanIn>=s&&i.fanOut>=n).sort((i,r)=>r.score-i.score||r.fanIn-i.fanIn).slice(0,f)}function b(e,t){let m=new Set(c(e,t,{limit:500}).map(n=>n.file)).size,s=new Set(a(e,t,{limit:500}).filter(n=>n.file!==t.relativePath).map(n=>`${n.symbol}|${n.file}`)).size;return{symbol:t.symbol,shortName:l(t.symbol),fanIn:m,fanOut:s,score:m*s,definedIn:t.relativePath}}export{E as a};
|
|
41
|
-
//# sourceMappingURL=chunk-ZPZLVFJQ.js.map
|
package/dist/chunk-ZZ3F6P3X.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{c as u}from"./chunk-IDCWMWWP.js";import{d as I,e as x,l as p}from"./chunk-FT4WPAEX.js";import{e as R}from"./chunk-NKU7Z242.js";import{c as h}from"./chunk-MWCN46ZX.js";import{d as b,p as S,t as y}from"./chunk-QL5MJOVA.js";import{c as d}from"./chunk-5IM4IQ6N.js";function g(o,c,n){let e=p(o).get(n);if(!e||e.length===0)return[];if(e.length===1)return[l(e[0])];let i=e.filter(f=>f.file===c);if(i.length>0)return i.map(l);let t=P(o,c),r=t.get(n);if(r)for(let f of r){let s=e.filter(m=>D(f,m.file));if(s.length>0)return s.map(l)}let a=new Set;for(let f of t.values())for(let s of f)a.add(s);for(let f of a){let s=e.filter(m=>D(f,m.file));if(s.length>0&&s.length===e.length)return s.map(l)}return[]}function j(o,c,n){let e=g(o,c,n);if(e.length>0)return e;let i=p(o).get(n);return!i||i.length===0?[]:i.map(l)}function C(o,c){let n=h(o,c);if(!n)return[];let e=d(n.symbol);if(!e)return[];let i=new Map;for(let t of u(o)){let r=b(o,t);if(!r||r.indexOf(e)===-1||t!==n.relativePath&&!g(o,t,e).some(s=>s.symbolId===n.symbolId))continue;let a=I(o,t,e,t===n.relativePath?{excludeStartLine:n.startLine,excludeEndLine:n.endLine}:{});a.length>0&&i.set(t,a)}return w(o,i)}function E(o,c){let n=new Map;for(let t of c){if(!t.leaf)continue;let r=n.get(t.leaf)??[];r.push(t),n.set(t.leaf,r)}if(n.size===0)return new Map;let e=new Set(c.map(t=>t.symbolId)),i=new Map;for(let t of u(o)){let r=x(o,t);if(r.size!==0){for(let a of r)if(n.has(a))for(let f of g(o,t,a)){if(!e.has(f.symbolId)||t===f.relativePath)continue;let s=i.get(f.symbolId);s||(s=new Set,i.set(f.symbolId,s)),s.add(t)}}}return i}function P(o,c){let n=new Map;for(let e of R(o,c)){if(!e.sourcePath)continue;let i=e.localName??e.importedName;if(i){let t=n.get(i);t||(t=new Set,n.set(i,t)),t.add(e.sourcePath)}if(e.kind==="namespace")for(let t of e.usedMembers){let r=n.get(t);r||(r=new Set,n.set(t,r)),r.add(e.sourcePath)}}return n}function D(o,c){let n=e=>e.replace(/\\/g,"/").replace(/^\.\//,"");return n(o)===n(c)}function l(o){return{symbolId:o.symbolId,symbol:o.symbol,relativePath:o.file}}function w(o,c){let n=[],e=new Set;for(let[i,t]of c){let r=S(o,i);for(let a of t){let f=y(r,a),s=`${i}|${a}|${f?.symbol??""}`;e.has(s)||(e.add(s),n.push({file:i,line:a,enclosingSymbol:f?.symbol??null}))}}return n}export{g as a,j as b,C as c,E as d};
|
|
2
|
-
//# sourceMappingURL=chunk-ZZ3F6P3X.js.map
|