scip-query 0.6.9 → 0.7.1
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 +3 -1
- package/dist/augment-vue-worker.js +1 -1
- package/dist/chunk-23YIGCYF.js +25 -0
- package/dist/{chunk-V4WRHJU3.js → chunk-2IYEIFPP.js} +6 -6
- package/dist/chunk-2JEFS2YJ.js +2 -0
- package/dist/chunk-33SSUPCB.js +7 -0
- package/dist/chunk-3GNFUVFA.js +2 -0
- package/dist/chunk-3OUC276S.js +2 -0
- package/dist/{chunk-JLFAQ2E2.js → chunk-4STLJYHI.js} +4 -4
- package/dist/chunk-563HLCDW.js +35 -0
- package/dist/chunk-5TT47UMX.js +44 -0
- package/dist/chunk-6H2XIIPY.js +71 -0
- package/dist/{chunk-I5BB33E6.js → chunk-72JOIFXL.js} +3 -3
- package/dist/chunk-7H4RJ4MC.js +2 -0
- package/dist/chunk-7O4MJYIW.js +63 -0
- package/dist/chunk-7OX2O53H.js +62 -0
- package/dist/chunk-A2AVLALL.js +2 -0
- package/dist/chunk-AQYBOORI.js +2 -0
- package/dist/chunk-ARBZM2NF.js +34 -0
- package/dist/{chunk-GRAEZYYU.js → chunk-BI4F6GXI.js} +2 -2
- package/dist/chunk-BOVNTAKQ.js +3 -0
- package/dist/chunk-CKIO6SVS.js +2 -0
- package/dist/chunk-D6Z67MZL.js +2 -0
- package/dist/chunk-DFK54IRN.js +2 -0
- package/dist/chunk-FD37DBTD.js +2 -0
- package/dist/chunk-FOQQDXE7.js +2 -0
- package/dist/chunk-GAQGJ52J.js +11 -0
- package/dist/chunk-IODTPF5H.js +20 -0
- package/dist/chunk-J6Z5YKGQ.js +4 -0
- package/dist/chunk-JB4PUN5S.js +40 -0
- package/dist/chunk-JTXKS5GK.js +3 -0
- package/dist/chunk-KJ3ZJIE5.js +2 -0
- package/dist/chunk-KJ6CW6EK.js +2 -0
- package/dist/{chunk-AXHDRSRI.js → chunk-KNA6Z7JB.js} +3 -3
- package/dist/{chunk-U3GYMGBX.js → chunk-LDV2B7ET.js} +8 -8
- package/dist/chunk-LWYIGRHR.js +5 -0
- package/dist/chunk-MDAYGS6T.js +2 -0
- package/dist/chunk-MX6F756F.js +2 -0
- package/dist/chunk-NHDPYW7O.js +2 -0
- package/dist/{chunk-IIKNAXAE.js → chunk-NKJKI6SE.js} +2 -2
- package/dist/chunk-NN3O7TPH.js +8 -0
- package/dist/chunk-NSTZMBAB.js +18 -0
- package/dist/chunk-NYEMZHUC.js +6 -0
- package/dist/chunk-OHEIZWIA.js +4 -0
- package/dist/chunk-PG3ZI5IH.js +2 -0
- package/dist/chunk-QAEDNTY7.js +2 -0
- package/dist/chunk-QE6MGGUY.js +2 -0
- package/dist/chunk-QPRIYXH4.js +2 -0
- package/dist/chunk-QWJBIBE6.js +3 -0
- package/dist/chunk-RCJEFQOK.js +4 -0
- package/dist/chunk-ROOHENEP.js +61 -0
- package/dist/{chunk-3JGBAAP7.js → chunk-ROZNBWIF.js} +2 -2
- package/dist/chunk-TGK5DFBJ.js +2 -0
- package/dist/chunk-TKDJQ2WD.js +59 -0
- package/dist/chunk-TRNAQABL.js +7 -0
- package/dist/chunk-U75WH4XG.js +2 -0
- package/dist/chunk-V53J46BX.js +2 -0
- package/dist/chunk-V76FCF5F.js +2 -0
- package/dist/chunk-VUBQBW7H.js +16 -0
- package/dist/chunk-WJQY2LGT.js +2 -0
- package/dist/{chunk-ZO5IFJRM.js → chunk-WODJHE6Z.js} +3 -3
- package/dist/{chunk-IX45SWX5.js → chunk-WPLKHAH7.js} +4 -4
- package/dist/chunk-XO6R3X5J.js +2 -0
- package/dist/chunk-YSZNAG4G.js +2 -0
- package/dist/chunk-ZNUPGRPR.js +3 -0
- package/dist/{chunk-UIM4WALN.js → chunk-ZXFTC5ET.js} +4 -4
- package/dist/cli.js +364 -527
- package/dist/config-types-CGIeLEpY.d.ts +108 -0
- package/dist/db-DdTPetj5.d.ts +69 -0
- package/dist/health-x7B4Xu_6.d.ts +119 -0
- package/dist/index.d.ts +100 -334
- package/dist/index.js +3 -131
- package/dist/postinstall.js +1 -1
- package/dist/queries/affected.d.ts +9 -2
- package/dist/queries/affected.js +1 -1
- package/dist/queries/bottlenecks.d.ts +12 -2
- package/dist/queries/bottlenecks.js +1 -1
- package/dist/queries/by-kind.d.ts +12 -2
- package/dist/queries/by-kind.js +1 -1
- package/dist/queries/call-graph.d.ts +19 -2
- package/dist/queries/call-graph.js +1 -1
- package/dist/queries/change-surface.d.ts +16 -2
- package/dist/queries/change-surface.js +1 -1
- package/dist/queries/code.d.ts +12 -2
- package/dist/queries/code.js +1 -1
- package/dist/queries/complexity-hotspots.d.ts +15 -2
- package/dist/queries/complexity-hotspots.js +1 -1
- package/dist/queries/complexity.d.ts +19 -2
- package/dist/queries/complexity.js +1 -1
- package/dist/queries/convergence.d.ts +22 -2
- package/dist/queries/convergence.js +1 -1
- package/dist/queries/coupling.d.ts +8 -2
- package/dist/queries/coupling.js +1 -1
- package/dist/queries/cycles.d.ts +16 -2
- package/dist/queries/cycles.js +1 -1
- package/dist/queries/dataflow.d.ts +32 -2
- package/dist/queries/dataflow.js +1 -1
- package/dist/queries/dead.d.ts +34 -2
- package/dist/queries/dead.js +1 -1
- package/dist/queries/deep-chains.d.ts +8 -2
- package/dist/queries/deep-chains.js +1 -1
- package/dist/queries/deps.d.ts +6 -2
- package/dist/queries/deps.js +1 -1
- package/dist/queries/diff-impact.d.ts +22 -2
- package/dist/queries/diff-impact.js +1 -1
- package/dist/queries/drift.d.ts +18 -2
- package/dist/queries/drift.js +1 -1
- package/dist/queries/extract-candidates.d.ts +19 -2
- package/dist/queries/extract-candidates.js +1 -1
- package/dist/queries/fan.d.ts +7 -2
- package/dist/queries/fan.js +1 -1
- package/dist/queries/files.d.ts +6 -2
- package/dist/queries/files.js +1 -1
- package/dist/queries/health.d.ts +4 -81
- package/dist/queries/health.js +1 -1
- package/dist/queries/hierarchy.d.ts +8 -2
- package/dist/queries/hierarchy.js +1 -1
- package/dist/queries/hotspots.d.ts +10 -2
- package/dist/queries/hotspots.js +1 -1
- package/dist/queries/imports.d.ts +13 -2
- package/dist/queries/imports.js +1 -1
- package/dist/queries/index.d.ts +45 -44
- package/dist/queries/index.js +1 -1
- package/dist/queries/isolated.d.ts +11 -2
- package/dist/queries/isolated.js +1 -1
- package/dist/queries/members.d.ts +10 -2
- package/dist/queries/members.js +1 -1
- package/dist/queries/methods.d.ts +8 -2
- package/dist/queries/methods.js +1 -1
- package/dist/queries/outline.d.ts +10 -2
- package/dist/queries/outline.js +1 -1
- package/dist/queries/passthrough-candidates.d.ts +14 -2
- package/dist/queries/passthrough-candidates.js +1 -1
- package/dist/queries/redundant-reexports.d.ts +13 -2
- package/dist/queries/redundant-reexports.js +1 -1
- package/dist/queries/refs.d.ts +7 -2
- package/dist/queries/refs.js +1 -1
- package/dist/queries/similar-chains.d.ts +21 -2
- package/dist/queries/similar-chains.js +1 -1
- package/dist/queries/similar-files.d.ts +12 -2
- package/dist/queries/similar-files.js +1 -1
- package/dist/queries/similar-signatures.d.ts +16 -2
- package/dist/queries/similar-signatures.js +1 -1
- package/dist/queries/similar.d.ts +21 -2
- package/dist/queries/similar.js +1 -1
- package/dist/queries/slice.d.ts +16 -2
- package/dist/queries/slice.js +1 -1
- package/dist/queries/stale-abstractions.d.ts +36 -3
- package/dist/queries/stale-abstractions.js +1 -1
- package/dist/queries/stats.d.ts +11 -2
- package/dist/queries/stats.js +1 -1
- package/dist/queries/surface.d.ts +8 -2
- package/dist/queries/surface.js +1 -1
- package/dist/queries/symbols.d.ts +10 -2
- package/dist/queries/symbols.js +1 -1
- package/dist/queries/system.d.ts +10 -2
- package/dist/queries/system.js +1 -1
- package/dist/queries/trace.d.ts +18 -2
- package/dist/queries/trace.js +1 -1
- package/dist/queries/wrapper-candidates.d.ts +14 -2
- package/dist/queries/wrapper-candidates.js +1 -1
- package/dist/reindex-worker.js +10 -10
- package/dist/reindex.d.ts +153 -0
- package/dist/reindex.js +69 -0
- package/dist/runtime.d.ts +108 -0
- package/dist/runtime.js +3 -0
- package/dist/scip-cli-a-xOztiK.d.ts +20 -0
- package/package.json +184 -4
- package/dist/chunk-2OP63JQQ.js +0 -2
- package/dist/chunk-33Z6HQBX.js +0 -5
- package/dist/chunk-3F453KPT.js +0 -2
- package/dist/chunk-3PKPUCIJ.js +0 -11
- package/dist/chunk-42BWO2NN.js +0 -2
- package/dist/chunk-4MDCFY3E.js +0 -2
- package/dist/chunk-4QWTQ6YV.js +0 -2
- package/dist/chunk-5IRX5I64.js +0 -5
- package/dist/chunk-5MPZ2A7J.js +0 -2
- package/dist/chunk-67OMD56K.js +0 -90
- package/dist/chunk-6UVVA5I4.js +0 -7
- package/dist/chunk-BAA4EJRX.js +0 -2
- package/dist/chunk-BT36WY5B.js +0 -114
- package/dist/chunk-CLKFDBS6.js +0 -39
- package/dist/chunk-CWMWTHV3.js +0 -2
- package/dist/chunk-DXO2ECRF.js +0 -7
- package/dist/chunk-EHEZLULQ.js +0 -85
- package/dist/chunk-FVH3Y44U.js +0 -1
- package/dist/chunk-GWBRU65E.js +0 -2
- package/dist/chunk-H4DXD2FB.js +0 -5
- package/dist/chunk-I2KUHGMX.js +0 -16
- package/dist/chunk-JMASYYSW.js +0 -2
- package/dist/chunk-KAM4C6ZD.js +0 -4
- package/dist/chunk-LBWLO7NA.js +0 -70
- package/dist/chunk-LJ2YWNQF.js +0 -2
- package/dist/chunk-LLDPR3DG.js +0 -6
- package/dist/chunk-LNUZWWWL.js +0 -2
- package/dist/chunk-NLJCXHFU.js +0 -84
- package/dist/chunk-NRAJIFQA.js +0 -2
- package/dist/chunk-OYRGWW6Z.js +0 -2
- package/dist/chunk-PVMRIOM6.js +0 -33
- package/dist/chunk-QRYEOK3M.js +0 -2
- package/dist/chunk-SF2HYG53.js +0 -4
- package/dist/chunk-SHGPRVWH.js +0 -2
- package/dist/chunk-SMOUOKAO.js +0 -2
- package/dist/chunk-TBJDUS4E.js +0 -71
- package/dist/chunk-TPXWXKL6.js +0 -2
- package/dist/chunk-TTCUMJ43.js +0 -19
- package/dist/chunk-TYR7QY5G.js +0 -2
- package/dist/chunk-UZG3QXTG.js +0 -2
- package/dist/chunk-VDMRAGBK.js +0 -6
- package/dist/chunk-W6SRVK2Y.js +0 -5
- package/dist/chunk-WGYJDGBI.js +0 -25
- package/dist/chunk-WYX3RU2K.js +0 -2
- package/dist/chunk-WZYA234B.js +0 -2
- package/dist/chunk-Y6ZFXZ7B.js +0 -2
- package/dist/chunk-YCN5XEST.js +0 -7
- package/dist/db-Rx8Ho_JF.d.ts +0 -838
- package/dist/queries/drift-policy.d.ts +0 -6
- package/dist/queries/drift-policy.js +0 -2
- package/dist/queries/health-cache-control.d.ts +0 -15
- package/dist/queries/health-cache-control.js +0 -2
package/dist/chunk-BT36WY5B.js
DELETED
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
import{K as y,L as S,s as E,t as I,v as L,w as $,x as v}from"./chunk-NLJCXHFU.js";function ne(e,t){let n=K(e,t.trim());if(n)return n;let s=B(e,t);if(s)return s;let a=F(e,t);return a||W(e,t)}function F(e,t){let n=C(t),s=w(n);if(!s)return null;let a=`%${s.path}%`,i=s.leaf,r=k(e,a,i,n)[0];return r?y(e,r):null}function k(e,t,n,s){let a=M([],[...J(e,t,n),...T(e,t,n)]).filter(i=>!e.isIgnored(i.relative_path)).filter(i=>_(i,s)>1);return a.sort((i,o)=>_(o,s)-_(i,s)||i.end_line-i.start_line-(o.end_line-o.start_line)||i.start_line-o.start_line||i.symbol.localeCompare(o.symbol)),a}function J(e,t,n){return e.all(`SELECT gs.id, gs.symbol, der.document_id, der.start_line, der.end_line, d.relative_path, gs.display_name, gs.documentation
|
|
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 (gs.display_name = ? OR gs.symbol LIKE ?)
|
|
7
|
-
${e.pathExclusionsFor("d")}`,t,n,`%/${n}.%`)}function T(e,t,n){return e.all(`SELECT
|
|
8
|
-
gs.id,
|
|
9
|
-
gs.symbol,
|
|
10
|
-
c.document_id,
|
|
11
|
-
MIN(c.start_line) AS start_line,
|
|
12
|
-
MAX(c.end_line) AS end_line,
|
|
13
|
-
d.relative_path,
|
|
14
|
-
gs.display_name,
|
|
15
|
-
gs.documentation
|
|
16
|
-
FROM global_symbols gs
|
|
17
|
-
JOIN mentions m ON m.symbol_id = gs.id
|
|
18
|
-
JOIN chunks c ON m.chunk_id = c.id
|
|
19
|
-
JOIN documents d ON c.document_id = d.id
|
|
20
|
-
WHERE m.role = 1
|
|
21
|
-
AND d.relative_path LIKE ?
|
|
22
|
-
AND (gs.display_name = ? OR gs.symbol LIKE ?)
|
|
23
|
-
${e.pathExclusionsFor("d")}
|
|
24
|
-
GROUP BY gs.id, gs.symbol, c.document_id, d.relative_path, gs.display_name, gs.documentation`,t,n,`%/${n}.%`)}function W(e,t){let n=C(t),s=j(t),a=z(e,s),i=q(a,t,n);if(i&&!e.isIgnored(i.relative_path))return y(e,i);let o=null;for(let r of a){if(e.isIgnored(r.relative_path))continue;let d=U(r,t,n,s);d<=0||(!o||d>o.score)&&(o={row:r,score:d})}return o?y(e,o.row):null}function B(e,t){let n=t.match(/^(.+):(\d+)-(\d+)$/);if(!n)return null;let[,s,a,i]=n,o=Math.max(0,parseInt(a,10)-1),r=Math.max(o,parseInt(i,10)-1),d=Y(e,s,o,r)??H(e,s,o,r);return d&&!e.isIgnored(d.relative_path)?y(e,d):null}function Y(e,t,n,s){return e.get(`SELECT gs.id, gs.symbol, der.document_id, der.start_line, der.end_line, d.relative_path
|
|
25
|
-
FROM global_symbols gs
|
|
26
|
-
JOIN defn_enclosing_ranges der ON gs.id = der.symbol_id
|
|
27
|
-
JOIN documents d ON der.document_id = d.id
|
|
28
|
-
WHERE d.relative_path LIKE ?
|
|
29
|
-
AND der.start_line <= ? AND der.end_line >= ?
|
|
30
|
-
${e.pathExclusionsFor("d")}
|
|
31
|
-
ORDER BY (der.end_line - der.start_line) ASC
|
|
32
|
-
LIMIT 1`,`%${t}%`,n,s)}function H(e,t,n,s){return 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
|
|
33
|
-
FROM global_symbols gs
|
|
34
|
-
JOIN mentions m ON m.symbol_id = gs.id
|
|
35
|
-
JOIN chunks c ON m.chunk_id = c.id
|
|
36
|
-
JOIN documents d ON c.document_id = d.id
|
|
37
|
-
WHERE m.role = 1
|
|
38
|
-
AND d.relative_path LIKE ?
|
|
39
|
-
AND c.start_line <= ? AND c.end_line >= ?
|
|
40
|
-
${e.pathExclusionsFor("d")}
|
|
41
|
-
GROUP BY gs.id, gs.symbol, c.document_id, d.relative_path
|
|
42
|
-
ORDER BY (MAX(c.end_line) - MIN(c.start_line)) ASC
|
|
43
|
-
LIMIT 1`,`%${t}%`,n,s)}function K(e,t){let s=e.get(`SELECT gs.id, gs.symbol, der.document_id, der.start_line, der.end_line, d.relative_path
|
|
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.symbol = ?
|
|
48
|
-
${e.pathExclusionsFor("d")}
|
|
49
|
-
ORDER BY d.relative_path, der.start_line
|
|
50
|
-
LIMIT 1`,t)??e.get(`SELECT
|
|
51
|
-
gs.id,
|
|
52
|
-
gs.symbol,
|
|
53
|
-
c.document_id,
|
|
54
|
-
MIN(c.start_line) AS start_line,
|
|
55
|
-
MAX(c.end_line) AS end_line,
|
|
56
|
-
d.relative_path
|
|
57
|
-
FROM global_symbols gs
|
|
58
|
-
JOIN mentions m ON m.symbol_id = gs.id
|
|
59
|
-
JOIN chunks c ON m.chunk_id = c.id
|
|
60
|
-
JOIN documents d ON c.document_id = d.id
|
|
61
|
-
WHERE gs.symbol = ?
|
|
62
|
-
AND m.role = 1
|
|
63
|
-
${e.pathExclusionsFor("d")}
|
|
64
|
-
GROUP BY gs.id, gs.symbol, c.document_id, d.relative_path
|
|
65
|
-
ORDER BY d.relative_path, start_line
|
|
66
|
-
LIMIT 1`,t);return!s||e.isIgnored(s.relative_path)?null:y(e,s)}function te(e,t){if("symbol"in t&&"relativePath"in t)return t;let n=X(e,t.symbolId)[0];return n?y(e,n):null}function X(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, gs.documentation
|
|
67
|
-
FROM global_symbols gs
|
|
68
|
-
JOIN defn_enclosing_ranges der ON gs.id = der.symbol_id
|
|
69
|
-
JOIN documents d ON der.document_id = d.id
|
|
70
|
-
WHERE gs.id = ?
|
|
71
|
-
ORDER BY der.start_line, der.end_line`,t),s=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
|
-
gs.documentation
|
|
80
|
-
FROM global_symbols gs
|
|
81
|
-
JOIN mentions m ON m.symbol_id = gs.id
|
|
82
|
-
JOIN chunks c ON m.chunk_id = c.id
|
|
83
|
-
JOIN documents d ON c.document_id = d.id
|
|
84
|
-
WHERE gs.id = ?
|
|
85
|
-
AND m.role = 1
|
|
86
|
-
${e.pathExclusionsFor("d")}
|
|
87
|
-
GROUP BY gs.id, gs.symbol, c.document_id, d.relative_path, gs.display_name, gs.documentation
|
|
88
|
-
ORDER BY start_line, end_line`,t);return M(n,s)}function z(e,t){let n=t.map(()=>"(gs.symbol LIKE ? OR d.relative_path LIKE ? OR COALESCE(gs.display_name, '') LIKE ?)"),s=t.flatMap(o=>{let r=`%${o}%`;return[r,r,r]}),a=e.all(`SELECT gs.id, gs.symbol, der.document_id, der.start_line, der.end_line, d.relative_path, gs.display_name, gs.documentation
|
|
89
|
-
FROM global_symbols gs
|
|
90
|
-
JOIN defn_enclosing_ranges der ON gs.id = der.symbol_id
|
|
91
|
-
JOIN documents d ON der.document_id = d.id
|
|
92
|
-
WHERE ${n.join(`
|
|
93
|
-
AND `)}
|
|
94
|
-
${e.pathExclusionsFor("d")}
|
|
95
|
-
LIMIT 200`,...s),i=e.all(`SELECT
|
|
96
|
-
gs.id,
|
|
97
|
-
gs.symbol,
|
|
98
|
-
c.document_id,
|
|
99
|
-
MIN(c.start_line) AS start_line,
|
|
100
|
-
MAX(c.end_line) AS end_line,
|
|
101
|
-
d.relative_path,
|
|
102
|
-
gs.display_name,
|
|
103
|
-
gs.documentation
|
|
104
|
-
FROM global_symbols gs
|
|
105
|
-
JOIN mentions m ON m.symbol_id = gs.id
|
|
106
|
-
JOIN chunks c ON m.chunk_id = c.id
|
|
107
|
-
JOIN documents d ON c.document_id = d.id
|
|
108
|
-
WHERE m.role = 1
|
|
109
|
-
AND ${n.join(`
|
|
110
|
-
AND `)}
|
|
111
|
-
${e.pathExclusionsFor("d")}
|
|
112
|
-
GROUP BY gs.id, gs.symbol, c.document_id, d.relative_path, gs.display_name, gs.documentation
|
|
113
|
-
LIMIT 200`,...s);return M(a,i)}function M(e,t){let n=new Map;for(let s of t)e.length>0&&!G(s)||n.set(s.id,s);for(let s of e)n.set(s.id,s);return[...n.values()]}function G(e){if(S(e.symbol)!==null)return!1;let n=(e.documentation??"").replace(/^```\w*\s*/,"").replace(/\s*```$/,"").trim();return/^(?:var|let|const|function|class|interface|type|enum)\b/.test(n)}function U(e,t,n,s){let a=t.trim(),i=n,o=i.replace(/\(\)$/,""),r=t.toLowerCase(),d=n.toLowerCase(),g=d.replace(/\(\)$/,""),D=e.symbol,R=E(e.symbol),p=I(e.symbol),Q=e.display_name??"",f=e.symbol.toLowerCase(),c=R.toLowerCase(),m=p.toLowerCase(),O=Q.toLowerCase(),u=e.relative_path.toLowerCase(),A=/[/:.]/.test(n),N=w(n),b=N?.leaf.toLowerCase(),l=0;return(D===a||D===i)&&(l+=1150),(R===a||R===i)&&(l+=1100),Q===o&&(l+=1180),p===o&&(l+=1160),(`${p}()`===a||`${p}()`===i)&&(l+=955),(f===r||f===d)&&(l+=1e3),(c===r||c===d)&&(l+=950),(u===r||u===d)&&(l+=925),(u.endsWith(`/${d}`)||u.endsWith(`/${r}`))&&(l+=875),O===g&&(l+=850),m===g&&(l+=825),(`${m}()`===r||`${m}()`===d)&&(l+=820),(c.endsWith(`:${d}`)||c.endsWith(`:${g}`)||c.endsWith(`:${g}()`))&&(l+=800),f.includes(d)&&(l+=120),c.includes(d)&&(l+=140),u.includes(d)&&(l+=140),O.includes(d)&&(l+=110),s.every(x=>{let h=x.toLowerCase();return f.includes(h)||c.includes(h)||u.includes(h)||O.includes(h)})&&(l+=100+s.length*15),N&&u.includes(N.path.toLowerCase())&&(l+=360,b&&(m===b||`${m}()`===b||`${m}()`==`${b}()`)&&(l+=700),L(e.symbol)&&(l+=180)),$(e.symbol)&&m===g&&(l+=60),!A&&v(e.symbol)&&(l-=160),l-=Math.min(50,Math.max(0,e.end_line-e.start_line)),l}function w(e){let t=e.trim().replace(/\\/g,"/"),n=t.lastIndexOf("/");if(n<=0||n===t.length-1)return null;let s=t.slice(n+1).replace(/\(\)$/,"");return!s||s.includes(".")?null:{path:t.slice(0,n),leaf:s}}function C(e){return e.trim().replace(/\(\)$/,"").replace(/\(.*$/,"")}function j(e){let t=C(e),n=t.split(/[^A-Za-z0-9_]+/).map(s=>s.trim()).filter(s=>s.length>0);return n.length>0?[...new Set(n)]:[t]}function q(e,t,n){let s=t.trim(),a=e.filter(i=>{let o=E(i.symbol),r=(i.display_name??"").trim();return i.symbol===s||o===s||o===n||r===s||r===n||`${r}()`===s||_(i,n)>1||i.relative_path===s});return a.length===0?null:(a.sort((i,o)=>_(o,n)-_(i,n)||i.end_line-i.start_line-(o.end_line-o.start_line)||i.relative_path.localeCompare(o.relative_path)||i.symbol.localeCompare(o.symbol)),a[0]??null)}function _(e,t){let n=w(t);if(!n)return 0;let s=e.relative_path.toLowerCase(),a=I(e.symbol).toLowerCase(),i=n.path.toLowerCase(),o=n.leaf.toLowerCase();return s.includes(i)?a!==o?1:L(e.symbol)?S(e.symbol)===null?5:4:S(e.symbol)===null?3:2:0}export{ne as a,K as b,te as c};
|
|
114
|
-
//# sourceMappingURL=chunk-BT36WY5B.js.map
|
package/dist/chunk-CLKFDBS6.js
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import{a as g}from"./chunk-LLDPR3DG.js";import{g as u}from"./chunk-33Z6HQBX.js";import{o as c}from"./chunk-67OMD56K.js";import{a as p}from"./chunk-BT36WY5B.js";import{s as l,t as d,x as f}from"./chunk-NLJCXHFU.js";function T(e,s,t={}){return h(e,s,t)?.map(r=>({symbol:r.symbol,shortName:r.shortName,fromFile:r.fromFile}))??[]}function M(e,s){let t=E(e,s);return t.length>0?t:N(e,s)}function J(e,s,t={}){return h(e,s,t)?.filter(r=>!r.used).map(r=>({symbol:r.symbol,shortName:r.shortName,importedIn:r.importer}))??[]}function E(e,s){return e.all(`SELECT DISTINCT gs.symbol, d.relative_path AS importer
|
|
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
|
-
JOIN global_symbols gs ON m.symbol_id = gs.id
|
|
6
|
-
WHERE gs.symbol LIKE ?
|
|
7
|
-
AND m.role = 2
|
|
8
|
-
ORDER BY d.relative_path`,`%${s}%`).filter(r=>!e.isIgnored(r.importer)).map(r=>({symbol:r.symbol,shortName:l(r.symbol),fromFile:r.importer}))}function N(e,s){let t=p(e,s),r=t?.relativePath??null,o=t?d(t.symbol):s.replace(/\(\)$/,""),m=t?f(t.symbol):!1,i=e.all(`SELECT relative_path
|
|
9
|
-
FROM documents
|
|
10
|
-
WHERE 1 = 1
|
|
11
|
-
${e.pathExclusionsFor("documents")}
|
|
12
|
-
ORDER BY relative_path`),a=new Set;for(let n of i)if(!e.isIgnored(n.relative_path))for(let b of u(e,n.relative_path))S(b,n.relative_path,{targetFile:r,targetLeaf:o,targetIsModule:m})&&a.add(n.relative_path);return[...a].sort().map(n=>({symbol:t?.symbol??o,shortName:t?l(t.symbol):o,fromFile:n}))}function S(e,s,t){return!e.sourcePath||t.targetFile&&_(e.sourcePath)!==_(t.targetFile)?!1:e.kind==="side-effect"||t.targetFile&&R(s)||t.targetIsModule||e.kind==="named"&&e.importedName===t.targetLeaf?!0:e.kind==="namespace"&&e.usedMembers.includes(t.targetLeaf)}function h(e,s,t={}){let r=g(e,s);return r?O(e,r,t)??(t.semantic===!1?null:F(e,r))??y(e,r):null}function O(e,s,t){let o=e.all(`SELECT DISTINCT
|
|
13
|
-
gs.symbol,
|
|
14
|
-
def_d.relative_path AS from_file,
|
|
15
|
-
imp_d.relative_path AS importer,
|
|
16
|
-
EXISTS (
|
|
17
|
-
SELECT 1
|
|
18
|
-
FROM mentions ref_m
|
|
19
|
-
JOIN chunks ref_c ON ref_m.chunk_id = ref_c.id
|
|
20
|
-
WHERE ref_m.symbol_id = gs.id
|
|
21
|
-
AND ref_m.role != 1
|
|
22
|
-
AND ref_c.document_id = imp_d.id
|
|
23
|
-
) AS used
|
|
24
|
-
FROM mentions m
|
|
25
|
-
JOIN chunks c ON m.chunk_id = c.id
|
|
26
|
-
JOIN documents imp_d ON c.document_id = imp_d.id
|
|
27
|
-
JOIN global_symbols gs ON m.symbol_id = gs.id
|
|
28
|
-
LEFT JOIN (
|
|
29
|
-
SELECT m2.symbol_id, c2.document_id
|
|
30
|
-
FROM mentions m2
|
|
31
|
-
JOIN chunks c2 ON m2.chunk_id = c2.id
|
|
32
|
-
WHERE m2.role = 1
|
|
33
|
-
GROUP BY m2.symbol_id
|
|
34
|
-
) sym_def ON sym_def.symbol_id = gs.id
|
|
35
|
-
LEFT JOIN documents def_d ON sym_def.document_id = def_d.id
|
|
36
|
-
WHERE imp_d.relative_path = ?
|
|
37
|
-
AND m.role = 2
|
|
38
|
-
ORDER BY def_d.relative_path, gs.symbol`,s).filter(m=>!e.isIgnored(m.importer));if(o.length>0){let m=t.semantic===!1?[]:c(e,s);return o.map(i=>({symbol:i.symbol,shortName:l(i.symbol),fromFile:i.from_file??"(external)",importer:i.importer,used:i.used!==0||m.some(a=>a.isUsed&&a.sourcePath===i.from_file)}))}return null}function F(e,s){let t=c(e,s);return t.length>0?t.map(r=>{let o=I(r.importedName,r.localName,r.kind);return{symbol:o,shortName:o,fromFile:r.sourcePath??"(external)",importer:s,used:r.kind==="side-effect"?!0:r.isUsed}}):null}function y(e,s){return u(e,s).map(t=>{let r=I(t.importedName,t.localName,t.kind),o=t.kind==="side-effect"?!0:t.used;return{symbol:r,shortName:r,fromFile:t.sourcePath??"(external)",importer:s,used:o}})}function I(e,s,t){return t==="namespace"&&e==="*"&&s?`* as ${s}`:t==="default"&&s?`default as ${s}`:t==="side-effect"?"(side effect import)":s&&s!==e?`${e} as ${s}`:e}function _(e){return e.replace(/\\/g,"/")}function R(e){return/\.(?:c|h|cc|cpp|cxx|hpp|hh|hxx)$/i.test(e)}export{T as a,M as b,J as c};
|
|
39
|
-
//# sourceMappingURL=chunk-CLKFDBS6.js.map
|
package/dist/chunk-CWMWTHV3.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as m}from"./chunk-LNUZWWWL.js";import{a as l}from"./chunk-BT36WY5B.js";import{t as r,v as a}from"./chunk-NLJCXHFU.js";import{basename as d}from"path";function g(t,c){let o=l(t,c);if(!o)return[];let s=r(o.symbol),i=new m(t).definitionsForFile(o.relativePath).filter(e=>a(e.symbol)),n=i.filter(e=>e.parentTypeName===s||e.symbol.includes(s));return(n.length>0?n:p(d(o.relativePath))===s?i.filter(e=>e.symbol.includes("<invalid-global-code>")):[]).map(e=>({startLine:e.startLine,endLine:e.endLine,name:r(e.symbol)}))}function p(t){return t.replace(/\.[^.]+$/,"")}export{g as a};
|
|
2
|
-
//# sourceMappingURL=chunk-CWMWTHV3.js.map
|
package/dist/chunk-DXO2ECRF.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import{a as F}from"./chunk-LNUZWWWL.js";import{f as g}from"./chunk-EHEZLULQ.js";import{J as M,s as p,t as I,z as C}from"./chunk-NLJCXHFU.js";import{basename as f,extname as d}from"path";function A(t,e){let{scope:n,maxLoc:o=15,limit:r=30,scanLimit:i}=e??{},a=new F(t),l=_(a.fileDependencyGraph(n)),u=j(x(a,n,o).sort((c,s)=>b(c)-b(s)||c.relativePath.localeCompare(s.relativePath)),i),h=P(a.crossFileCallerMap(u,{semantic:e?.semantic!==!1}),a.sourceFallbackCallerFiles(u)),m=[];for(let c of u){let s=S(t,a,c,{callerFileMap:h,reverseFanIn:l});s&&m.push(s)}return m.sort((c,s)=>s.callerFanIn-c.callerFanIn||s.loc-c.loc),m.slice(0,r)}function S(t,e,n,o){let r=D(e,n,o.callerFileMap);if(r.length!==1)return null;let i=r[0],a=L(t,n.symbolId,i);if(!a)return null;let l=y(e,t,i,n.symbol,a);if(l&&C(l.symbol))return null;let u=v(o.callerFileMap,o.reverseFanIn,i,l);return u<=3?null:{symbol:n.symbol,shortName:p(n.symbol),file:n.relativePath,startLine:n.startLine,endLine:n.endLine,loc:b(n),singleCaller:l?.symbol??"",singleCallerShort:l?.isFunctionLike?p(l.symbol):f(i),callerFanIn:u}}function b(t){return t.endLine-t.startLine+1}function x(t,e,n){return t.productionCallableDefinitions({scope:e,minLoc:2,maxLoc:n,requireFunctionLikeSymbol:!0})}function D(t,e,n){let o=f(e.relativePath,d(e.relativePath));return[...n.get(e.symbolId)??[]].filter(r=>r!==e.relativePath).filter(r=>f(r,d(r))!==o).filter(r=>{let i=t.fileKind(r);return i!=="barrel"&&i!=="entry"&&i!=="test"})}function L(t,e,n){return t.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`,e,n)}function y(t,e,n,o,r){let i=t.definitionsForFile(n),a=k(e,n,o,r.start_line,r.end_line);return M(i,a)}function v(t,e,n,o){if(o?.isFunctionLike){let r=[...t.get(o.symbolId)??[]].filter(i=>i!==o.relativePath);if(r.length>0)return r.length}return N(e,n)}function k(t,e,n,o,r){let i=I(n);if(!i)return o;let a=g(t,e).get(i);if(!a||a.length===0)return o;for(let l of a)if(l>=o&&l<=r)return l;return o}function P(...t){let e=new Map;for(let n of t)for(let[o,r]of n){let i=e.get(o);i||(i=new Set,e.set(o,i));for(let a of r)i.add(a)}return e}function _(t){let e=new Map;for(let[n,o]of t){e.has(n)||e.set(n,e.get(n)??0);for(let r of o)e.set(r,(e.get(r)??0)+1)}return e}function N(t,e){let n=t.get(e)??0;if(n>0)return n;let o=f(e,d(e)),r=0;for(let[i,a]of t)i!==e&&f(i,d(i))===o&&a>r&&(r=a);return r}function j(t,e){return typeof e!="number"||e<=0||t.length<=e?t:t.slice(0,e)}export{A as a};
|
|
7
|
-
//# sourceMappingURL=chunk-DXO2ECRF.js.map
|
package/dist/chunk-EHEZLULQ.js
DELETED
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import{a as G,b as W,e as B,g as N}from"./chunk-33Z6HQBX.js";import{p as U,q as Y,r as V}from"./chunk-67OMD56K.js";import{c as z}from"./chunk-BT36WY5B.js";import{F as M,G as k,J as v,a as h,b as w,d as x,h as y,l as S,m as C,o as A,q as J,t as L,v as j}from"./chunk-NLJCXHFU.js";var E=new WeakMap;function St(e,t){let n=y(t);return n==="rust"?Se(e,t):n==="typescript"||n==="tsx"||n==="javascript"?ye(e,t):[]}var be=new Set(["describe","it","test","fdescribe","fit","xdescribe","xit","beforeEach","afterEach","beforeAll","afterAll","before","after","suite","bench","benchmark"]);function ye(e,t){let n=S(e,t);if(!n)return[];let s=E.get(n);if(s)return s;let o=/(^|\/)(pages|app)\/.+\.(tsx?|jsx?)$/.test(t)||/(^|\/)(layout|page|loading|error|not-found|head|template|default)\.(tsx?|jsx?)$/.test(t),i=/(^|\/)src\/(pages|views|routes)\/.+\.(tsx?|jsx?|vue)$/.test(t),a=!1,l=n.rootNode;for(let r of l.namedChildren){if(r.type!=="expression_statement")continue;let u=r.namedChild(0);if(!u||u.type!=="call_expression")continue;let d=u.namedChild(0);if(!d)continue;let f=d.type==="member_expression"?d.namedChild(d.namedChildCount-1)?.text:d.text;if(f&&be.has(f)){a=!0;break}}let c=[];a&&c.push({startLine:0,endLine:l.endPosition.row,reason:"TS/JS test file (describe/it/test at top level)"}),(o||i)&&c.push({startLine:0,endLine:l.endPosition.row,reason:o?"Next.js / Remix route file":"Vite/Vue route component"});for(let r of l.namedChildren){let u=null,d=null;if(r.type==="function_declaration")u=r.namedChild(0)?.text??null,d=r;else if(r.type==="export_statement"){let f=r.namedChild(0);f?.type==="function_declaration"&&(u=f.namedChild(0)?.text??null,d=f)}else if(r.type==="lexical_declaration"){let f=r.namedChild(0);if(f?.type==="variable_declarator"){let p=f.namedChild(0)?.text,g=f.namedChild(1);p&&(g?.type==="arrow_function"||g?.type==="function_expression")&&(u=p,d=f)}}u&&/^use[A-Z]/.test(u)&&d&&c.push({startLine:d.startPosition.row,endLine:d.endPosition.row,reason:"React custom hook (use*)"})}return c.push(...q(n,new Set(["function_declaration","method_definition","class_declaration","interface_declaration","type_alias_declaration","enum_declaration","variable_declarator","export_statement"]),new Set(["comment"]))),E.set(n,c),c}var _e=/scip-query[\s:-]*ignore[\s:-]*(?:dead(?:-code)?|stale)?/i;function he(e){return _e.test(e)}function q(e,t,n){let s=[],o=i=>{if(t.has(i.type)&&i.parent){let l=i.parent.children,c=-1;for(let r=0;r<l.length;r+=1)if(l[r].startIndex===i.startIndex&&l[r].type===i.type){c=r;break}if(c>0)for(let r=c-1;r>=0;r-=1){let u=l[r];if(n.has(u.type)){if(he(u.text)){s.push({startLine:i.startPosition.row,endLine:i.endPosition.row,reason:"scip-query suppression comment"});break}continue}if(!(u.type==="attribute_item"||u.type==="inner_attribute_item"))break}}for(let a of i.namedChildren)o(a)};return o(e.rootNode),s}function Se(e,t){let n=S(e,t);if(!n)return[];let s=E.get(n);if(s)return s;let o=[],i=Ee(n);return i?(E.set(n,i),i):(X(n.rootNode,o,!1,!1),o.push(...q(n,new Set(["function_item","function_signature_item","struct_item","enum_item","union_item","impl_item","mod_item","static_item","const_item"]),new Set(["line_comment","block_comment"]))),o.push(...xe(n.rootNode)),E.set(n,o),o)}function Ee(e){return Ae(e.rootNode)?[{startLine:0,endLine:e.rootNode.endPosition.row,reason:"generated file (@generated header)"}]:null}function X(e,t,n,s){let o=n,i=s;e.type==="trait_item"&&t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"trait declaration body (dynamic dispatch)"}),e.type==="impl_item"&&e.childForFieldName("trait")&&(i=!0,t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"trait impl block (dynamic dispatch)"})),e.type==="function_item"||e.type==="function_signature_item"?Re(e,t,n,s):s&&we(e)?t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"trait impl associated item (dynamic dispatch)"}):e.type==="struct_item"||e.type==="enum_item"||e.type==="union_item"?Ce(e,t,n):e.type==="mod_item"&&D(e).some(a=>/#\[\s*cfg\s*\(\s*test\s*\)/.test(a))&&(o=!0);for(let a of e.namedChildren)X(a,t,o,i)}function Re(e,t,n,s){let o=D(e),i=null;s?i="trait impl method (dynamic dispatch)":n&&(i="inside #[cfg(test)] mod");for(let a of o){let l=Le(a);if(l){i=l;break}if(Q(a)){i="#[allow(dead_code)]";break}}i&&t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:i})}function Ce(e,t,n){let s=D(e),o=e.namedChildren.find(i=>i.type==="type_identifier")?.text;s.some(Ie)&&t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"#[derive(<reflective>)] \u2014 fields accessed via macro/reflection",containerName:o}),s.some(Q)&&t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"#[allow(dead_code)]",containerName:o}),n&&t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"inside #[cfg(test)] mod",containerName:o})}function D(e){let t=e.parent;if(!t)return[];let n=t.children,s=-1;for(let i=0;i<n.length;i+=1)if(n[i].startIndex===e.startIndex&&n[i].type===e.type){s=i;break}if(s<=0)return[];let o=[];for(let i=s-1;i>=0;i-=1){let a=n[i];if(a.type==="attribute_item"||a.type==="inner_attribute_item")o.push(a.text);else{if(a.type==="line_comment"||a.type==="block_comment")continue;break}}return o}function Le(e){return/#\[\s*tauri::command\b/.test(e)?"#[tauri::command]":/#\[\s*command\b/.test(e)?"#[command]":/#\[\s*test\b/.test(e)?"#[test]":/#\[\s*bench\b/.test(e)?"#[bench]":/#\[\s*tokio::test\b/.test(e)?"#[tokio::test]":/#\[\s*async_std::test\b/.test(e)?"#[async_std::test]":/#\[\s*wasm_bindgen\b/.test(e)?"#[wasm_bindgen]":/#\[\s*no_mangle\b/.test(e)?"#[no_mangle]":/#\[\s*napi\b/.test(e)?"#[napi]":/#\[\s*pyfunction\b/.test(e)?"#[pyfunction]":/#\[\s*pymethod\b/.test(e)?"#[pymethod]":/#\[\s*pyo3\b/.test(e)?"#[pyo3]":/#\[\s*cfg\s*\(\s*test\s*\)/.test(e)?"#[cfg(test)]":/#\[\s*doc\s*\(\s*hidden\s*\)/.test(e)?"#[doc(hidden)]":null}function Ie(e){return/#\[\s*derive\s*\(/.test(e)?/\bSerialize\b/.test(e)||/\bDeserialize\b/.test(e)||/\bFromRow\b/.test(e)||/\bDeriveEntityModel\b/.test(e)||/\bIntoSchema\b/.test(e)||/\bToSchema\b/.test(e)||/\bDeriveValueType\b/.test(e)||/\bsqlx::FromRow\b/.test(e)||/\bError\b/.test(e)||/\bthiserror::Error\b/.test(e):!1}function Q(e){return/#\[\s*allow\s*\(\s*dead_code\s*\)/.test(e)}function we(e){return e.type==="const_item"||e.type==="type_item"||e.type==="static_item"||e.type==="associated_type"}function xe(e){let t=De(e);if(t.size===0)return[];let n=[];for(let s of e.descendantsOfType("mod_item")){let o=s.childForFieldName("name")?.text;o&&t.has(o)&&n.push({startLine:s.startPosition.row,endLine:s.endPosition.row,reason:'serde `with = "..."` module \u2014 body invoked via reflection',containerName:o})}return n}function Ae(e){for(let t=0;t<Math.min(e.namedChildCount,12);t+=1){let n=e.namedChild(t);if(!n||n.type!=="line_comment"&&n.type!=="block_comment")break;if(/@generated\b/.test(n.text)||/This file is .*generated\b/i.test(n.text)||/Code generated by/i.test(n.text)||/Generated by:\s*https?:\/\/openapi-generator/i.test(n.text)||/openapi-generator/i.test(n.text)&&/Generated by/i.test(n.text))return!0}return!1}var Ne=[{key:"default",re:/\bdefault\s*=\s*"([^"]+)"/g},{key:"with",re:/\bwith\s*=\s*"([^"]+)"/g},{key:"serialize_with",re:/\bserialize_with\s*=\s*"([^"]+)"/g},{key:"deserialize_with",re:/\bdeserialize_with\s*=\s*"([^"]+)"/g},{key:"skip_serializing_if",re:/\bskip_serializing_if\s*=\s*"([^"]+)"/g},{key:"getter",re:/\bgetter\s*=\s*"([^"]+)"/g},{key:"rename_all_with",re:/\brename_all_with\s*=\s*"([^"]+)"/g},{key:"schema_with",re:/\bschema_with\s*=\s*"([^"]+)"/g}],ee=/^#!?\[\s*serde\s*\(/,Me=/^#!?\[\s*schemars\s*\(/,ke=/^#!?\[\s*validate\s*\(/,K=/\bwith\s*=\s*"([^"]+)"/g;function te(e,t){return A(e,t,ve,()=>new Set,(n,s,o)=>{if(s==="rust"){for(let i of n.rootNode.descendantsOfType("attribute_item"))Z(i.text,o);for(let i of n.rootNode.descendantsOfType("inner_attribute_item"))Z(i.text,o)}})??new Set}var ve=new WeakMap;function Z(e,t){let n=ee.test(e),s=Me.test(e),o=ke.test(e);if(!(!n&&!s&&!o))for(let{re:i}of Ne){i.lastIndex=0;let a;for(;(a=i.exec(e))!==null;){let l=a[1],c=l.split("::").pop()??l;c==="is_none"&&/\bOption\b/.test(l)||c==="is_empty"&&/\b(String|Vec|HashMap|BTreeMap|HashSet|BTreeSet)\b/.test(l)||c&&t.add(c)}}}function De(e){let t=new Set;for(let n of e.descendantsOfType("attribute_item")){if(!ee.test(n.text))continue;K.lastIndex=0;let s;for(;(s=K.exec(n.text))!==null;){let o=s[1],i=o.split("::").pop()??o;i&&t.add(i)}}return t}var Oe=new Set(["invoke","invokeTauriCommand","listen","once","emit","subscribe","dispatch","sendCommand","callRust"]);function Et(e,t){return A(e,t,Te,()=>new Set,(n,s,o)=>{if(!(s!=="typescript"&&s!=="tsx"&&s!=="javascript"))for(let i of n.rootNode.descendantsOfType("call_expression")){let a=i.namedChild(0);if(!a)continue;let l=J(a);if(!l||!Oe.has(l))continue;let c=i.namedChildren.find(d=>d.type==="arguments");if(!c)continue;let r=c.namedChild(0);if(!r||r.type!=="string")continue;let u=r.namedChildren.find(d=>d.type==="string_fragment");u&&o.add(u.text)}})??new Set}var Te=new WeakMap;var Fe=new Set(["identifier","type_identifier","field_identifier"]),Pe=new Set(["identifier"]),He=new Set(["identifier","property_identifier","type_identifier"]),$e=new Set(["rust","python"]),Je=/\{([^{}]*)\}/g,Ge=/\b([A-Za-z_][\w]*)\b/g;function ie(e,t,n,s={}){if(!n)return[];let o=x(e,t);if(!o)return[];if(o.indexOf(n)===-1)return[];if(y(t))return(F(e,t).get(n)??[]).filter(u=>!ne(u,s));let i=W(e,t,o),a=new RegExp(`\\b${B(n)}\\b`),l=[];for(let c=0;c<i.length;c++)ne(c,s)||a.test(i[c]??"")&&l.push(c);return l}function ne(e,t){return typeof t.excludeStartLine=="number"&&typeof t.excludeEndLine=="number"&&e>=t.excludeStartLine&&e<=t.excludeEndLine}var O=h("file-identifiers");function xt(e,t){return O.get(e,t,()=>new Set(F(e,t).keys()))}var T=h("file-ident-lines");function F(e,t){return T.get(e,t,()=>We(e,t))}var P=h("file-idents-by-line");function se(e,t){return P.get(e,t,()=>{let n=F(e,t),s=0;for(let i of n.values()){let a=i[i.length-1];a!==void 0&&a>s&&(s=a)}let o=new Array(s+1);for(let i=0;i<=s;i+=1)o[i]=new Set;for(let[i,a]of n)for(let l of a)o[l].add(i);return o})}function At(e){O.invalidateAll(e),T.invalidateAll(e),P.invalidateAll(e)}function Nt(e,t){O.invalidate(e,t),T.invalidate(e,t),P.invalidate(e,t)}function We(e,t){let n=new Map,s=(l,c)=>{let r=n.get(l);if(!r){n.set(l,[c]);return}r[r.length-1]!==c&&r.push(c)};if(y(t)){let l=S(e,t);if(l){let c=y(t),r=c==="rust"?Fe:c==="python"?Pe:He,u=d=>{if(r.has(d.type)&&s(d.text,d.startPosition.row),c&&$e.has(c)&&d.type==="string_content"){let f=d.startPosition.row;for(let p of d.text.matchAll(Je)){let g=p[1]??"";for(let m of g.matchAll(Ge))m[1]&&s(m[1],f)}}for(let f of d.children)u(f)};return u(l.rootNode),n}}let o=x(e,t);if(!o)return n;let i=G(o).split(/\r?\n/),a=/\b([A-Za-z_$][\w$]*)\b/g;for(let l=0;l<i.length;l+=1){let c=i[l]??"";for(let r of c.matchAll(a))r[1]&&s(r[1],l)}return n}var le=h("file-dep-graph");function Jt(e){le.invalidateAll(e),ce.invalidate(e),me.invalidate(e)}function Gt(e,t){return le.get(e,t??"",()=>{let n=new Map,s=je(e),o=(i,a)=>ze(e,n,s,i,a);for(let i of Be(e,t))o(i.from_file,i.to_file);for(let i of s)if(!(t&&!i.includes(t)))for(let a of N(e,i))a.sourcePath&&o(i,a.sourcePath);return n})}function Be(e,t){let n=t?`AND d1.relative_path LIKE '%${t}%'`:"";return e.all(`SELECT DISTINCT
|
|
2
|
-
d1.relative_path AS from_file,
|
|
3
|
-
d2.relative_path AS to_file
|
|
4
|
-
FROM mentions m
|
|
5
|
-
JOIN chunks c ON m.chunk_id = c.id
|
|
6
|
-
JOIN documents d1 ON c.document_id = d1.id
|
|
7
|
-
JOIN global_symbols gs ON m.symbol_id = gs.id
|
|
8
|
-
JOIN (
|
|
9
|
-
SELECT m2.symbol_id, c2.document_id
|
|
10
|
-
FROM mentions m2
|
|
11
|
-
JOIN chunks c2 ON m2.chunk_id = c2.id
|
|
12
|
-
WHERE m2.role = 1
|
|
13
|
-
GROUP BY m2.symbol_id
|
|
14
|
-
) sym_def ON sym_def.symbol_id = gs.id
|
|
15
|
-
JOIN documents d2 ON sym_def.document_id = d2.id
|
|
16
|
-
WHERE d1.id != d2.id
|
|
17
|
-
AND m.role != 1
|
|
18
|
-
${e.pathExclusionsFor("d1","d2")}
|
|
19
|
-
${n}`)}function je(e){return new Set(e.all(`SELECT relative_path
|
|
20
|
-
FROM documents
|
|
21
|
-
WHERE 1 = 1
|
|
22
|
-
${e.pathExclusionsFor("documents")}
|
|
23
|
-
ORDER BY relative_path`).map(t=>t.relative_path).filter(t=>!e.isIgnored(t)))}function ze(e,t,n,s,o){if(s===o||e.isIgnored(s)||e.isIgnored(o)||!n.has(o))return;let i=t.get(s);i||(i=new Set,t.set(s,i)),i.add(o)}function Wt(e,t,n={}){let s=ue(e,[t],{additive:n.additive,semantic:n.semantic}),o=n.callableOnly?(s.get(t.symbolId)??[]).filter(i=>j(i.symbol)):s.get(t.symbolId)??[];return typeof n.limit=="number"?o.slice(0,n.limit):o}function Bt(e,t,n={}){let s=Ye(e)?Ke(e,t,{semantic:n.semantic!==!1}):Ve(e).get(t.symbolId)??[];return typeof n.limit=="number"?s.slice(0,n.limit):s}var ce=w("caller-rows"),Ue=2e4;function Ye(e){return(e.get("SELECT COUNT(*) AS count FROM global_symbols")?.count??0)>Ue}function Ve(e){return ce.get(e,()=>{let t=k(e),n=ue(e,t),s=new Map;for(let a of t)s.set(a.symbol,a.symbolId);let o=new Map,i=new Map;for(let a of t){let l=n.get(a.symbolId);if(!(!l||l.length===0))for(let c of l){let r=s.get(c.symbol);if(r===void 0||r===a.symbolId)continue;let u=o.get(r);u||(u=[],o.set(r,u),i.set(r,new Set));let d=`${a.symbol}|${a.relativePath}`;i.get(r).has(d)||(i.get(r).add(d),u.push({symbol:a.symbol,file:a.relativePath}))}}return o})}function Ke(e,t,n){let s=[],o=new Set,i=l=>{if(l.symbol===t.symbol)return;let c=`${l.symbol}|${l.file}`;o.has(c)||(o.add(c),s.push(l))};for(let l of qe(e,t))l.file!==t.relativePath&&i({symbol:l.enclosingSymbol??l.file,file:l.file});let a=n.semantic?Ze(e,t):null;if(a)for(let l of U(e,a)){if(l.file===t.relativePath||e.isIgnored(l.file))continue;let c=v(M(e,l.file),l.line);i({symbol:c?.symbol??l.file,file:l.file})}return s}function Ze(e,t){return e.get(`SELECT
|
|
24
|
-
d.id AS documentId,
|
|
25
|
-
gs.id AS symbolId,
|
|
26
|
-
gs.symbol,
|
|
27
|
-
d.relative_path AS relativePath,
|
|
28
|
-
COALESCE(der.start_line, c.start_line) AS startLine,
|
|
29
|
-
COALESCE(der.end_line, c.end_line) AS endLine,
|
|
30
|
-
COALESCE(gs.display_name, '') AS leaf,
|
|
31
|
-
NULL AS parentTypeName,
|
|
32
|
-
CASE WHEN gs.kind IN (6, 12, 13) OR gs.symbol LIKE '%().' THEN 1 ELSE 0 END AS isFunctionLike,
|
|
33
|
-
CASE WHEN gs.kind IN (5, 8, 11) THEN 1 ELSE 0 END AS isTypeLike,
|
|
34
|
-
gs.kind AS kind,
|
|
35
|
-
gs.documentation AS documentation,
|
|
36
|
-
gs.enclosing_symbol AS enclosingSymbol
|
|
37
|
-
FROM global_symbols gs
|
|
38
|
-
LEFT JOIN defn_enclosing_ranges der ON der.symbol_id = gs.id
|
|
39
|
-
LEFT JOIN chunks c ON c.document_id = der.document_id
|
|
40
|
-
JOIN documents d ON d.id = COALESCE(der.document_id, c.document_id)
|
|
41
|
-
WHERE gs.id = ?
|
|
42
|
-
LIMIT 1`,t.symbolId)??null}function qe(e,t){let n=nt(e,t);return n?it(e,Xe(e,n.match,n.identifier)):[]}function Xe(e,t,n){let s=new Map;for(let[o,i]of Qe(e,t.symbolId))s.set(o,et(e,o,i,t,n));return s}function Qe(e,t){let n=new Map,s=e.all(`SELECT DISTINCT d.relative_path, c.start_line, c.end_line
|
|
43
|
-
FROM mentions m
|
|
44
|
-
JOIN chunks c ON m.chunk_id = c.id
|
|
45
|
-
JOIN documents d ON c.document_id = d.id
|
|
46
|
-
WHERE m.symbol_id = ?
|
|
47
|
-
AND m.role != 1
|
|
48
|
-
${e.pathExclusionsFor("d")}
|
|
49
|
-
ORDER BY d.relative_path, c.start_line`,t);for(let o of s){if(e.isIgnored(o.relative_path))continue;let i=n.get(o.relative_path);i||(i=[],n.set(o.relative_path,i)),i.push({start_line:o.start_line,end_line:o.end_line})}return n}function et(e,t,n,s,o){let i=t===s.relativePath?{excludeStartLine:s.startLine,excludeEndLine:s.endLine}:{},a=o?ie(e,t,o,i):[];return n.flatMap(l=>tt(a,l))}function tt(e,t){let n=e.filter(s=>s>=t.start_line&&s<=t.end_line);return n.length>0?n:[t.start_line]}function nt(e,t){let n=z(e,t);return n?{match:n,identifier:L(n.symbol)||null}:null}function it(e,t){let n=[],s=new Set;for(let[o,i]of t){let a=M(e,o);for(let l of i){let c=v(a,l),r=`${o}|${l}|${c?.symbol??""}`;s.has(r)||(s.add(r),n.push({file:o,line:l,enclosingSymbol:c?.symbol??null}))}}return n}function ue(e,t,n={}){if(t.length===0)return new Map;let s=n.additive??!1,o=[],i=[];for(let u of t)y(u.relativePath)&&C(e,u.relativePath)!==null?o.push(u):i.push(u);let a=new Map,l=new Map,c=u=>{for(let[d,f]of u){let p=a.get(d);p||(p=[],a.set(d,p));let g=l.get(d);g||(g=new Set,l.set(d,g));for(let m of f){let b=`${m.symbol}|${m.chunkId}`;g.has(b)||(g.add(b),p.push(m))}}};o.length>0&&c(st(e,o)),n.semantic!==!1&&c(yt(V(e,t)));let r=s?t:i;return r.length>0&&c(ct(e,r)),a}function st(e,t){let n=new Map,s=ot(t,n),o=pe(e);for(let[i,a]of s){let l=C(e,i);if(l)for(let c of l){let r=rt(a,c.line);if(!r)continue;let u=at(e,i,o,c.calleeLeaf,c.memberAccess);u&&u.symbol!==r.symbol&&n.get(r.symbolId).push({symbol:u.symbol,file:u.file,chunkId:c.line})}}return n}function ot(e,t){let n=new Map;for(let s of e){let o=n.get(s.relativePath);o?o.push(s):n.set(s.relativePath,[s]),t.set(s.symbolId,[])}for(let s of n.values())s.sort((o,i)=>o.endLine-o.startLine-(i.endLine-i.startLine));return n}function rt(e,t){return e.find(n=>t>=n.startLine&&t<=n.endLine)??null}function at(e,t,n,s,o){let i=de(t,n.get(s)??[]);return i.length===0?null:fe(e,t,i,o)}function de(e,t){let n=oe(e);return n?t.filter(s=>oe(s.file)===n):t}function fe(e,t,n,s){let o=n.find(i=>i.file===t);if(o)return o;if(s){let i=new Set(N(e,t).map(a=>a.sourcePath).filter(a=>!!a));for(let a of n)for(let l of i)if(lt(l,a.file))return a;return null}return n.length===1?n[0]:null}function lt(e,t){let n=s=>s.replace(/\\/g,"/").replace(/^\.\//,"");return n(e)===n(t)}function oe(e){let t=y(e);return t?t==="typescript"||t==="tsx"||t==="javascript"?"javascript-family":t:null}var me=w("global-leaf-index");function pe(e){return me.get(e,()=>{let t=e.all(`SELECT gs.id, gs.symbol,
|
|
50
|
-
COALESCE(der_doc.relative_path, mention_doc.relative_path) AS relative_path
|
|
51
|
-
FROM global_symbols gs
|
|
52
|
-
LEFT JOIN defn_enclosing_ranges der ON der.symbol_id = gs.id
|
|
53
|
-
LEFT JOIN documents der_doc ON der_doc.id = der.document_id
|
|
54
|
-
LEFT JOIN (
|
|
55
|
-
SELECT m.symbol_id, MIN(d.relative_path) AS relative_path
|
|
56
|
-
FROM mentions m
|
|
57
|
-
JOIN chunks c ON m.chunk_id = c.id
|
|
58
|
-
JOIN documents d ON c.document_id = d.id
|
|
59
|
-
WHERE m.role = 1
|
|
60
|
-
GROUP BY m.symbol_id
|
|
61
|
-
) mention_doc ON mention_doc.symbol_id = gs.id
|
|
62
|
-
WHERE 1 = 1
|
|
63
|
-
${e.symbolNoiseFor("gs")}`),n=new Map;for(let s of t){if(!s.relative_path||e.isIgnored(s.relative_path))continue;let o=L(s.symbol);if(!o)continue;let i=n.get(o);i||(i=[],n.set(o,i)),i.some(a=>a.symbolId===s.id)||i.push({symbol:s.symbol,symbolId:s.id,file:s.relative_path})}return n})}function ct(e,t){if(t.length===0)return new Map;let n=e.all(`SELECT c.document_id, c.id AS chunk_id, c.start_line, c.end_line, m.symbol_id
|
|
64
|
-
FROM mentions m
|
|
65
|
-
JOIN chunks c ON m.chunk_id = c.id
|
|
66
|
-
WHERE m.role != 1`),s=new Map;for(let r of n)s.has(r.document_id)||s.set(r.document_id,[]),s.get(r.document_id).push(r);let o=new Map(e.all("SELECT id, relative_path FROM documents").map(r=>[r.id,r.relative_path])),i=new Map,a=e.all(`SELECT gs.id AS symbol_id, gs.symbol,
|
|
67
|
-
COALESCE(der.document_id, def_chunk.document_id) AS document_id
|
|
68
|
-
FROM global_symbols gs
|
|
69
|
-
LEFT JOIN defn_enclosing_ranges der ON der.symbol_id = gs.id
|
|
70
|
-
LEFT JOIN (
|
|
71
|
-
SELECT m.symbol_id, MIN(c.document_id) AS document_id
|
|
72
|
-
FROM mentions m
|
|
73
|
-
JOIN chunks c ON m.chunk_id = c.id
|
|
74
|
-
WHERE m.role = 1
|
|
75
|
-
GROUP BY m.symbol_id
|
|
76
|
-
) def_chunk ON def_chunk.symbol_id = gs.id`);for(let r of a)i.has(r.symbol_id)||i.set(r.symbol_id,{symbol:r.symbol,file:r.document_id!==null?o.get(r.document_id)??"":""});let l=new Map,c=o;for(let r of t){let u=s.get(r.documentId)??[],d=new Set,f=[],p=null,g=()=>{if(p)return p;let m=c.get(r.documentId)??"",b=new Set;if(m){let I=se(e,m),R=Math.max(0,r.startLine),$=Math.min(I.length-1,r.endLine);for(let _=R;_<=$;_+=1)for(let ge of I[_])b.add(ge)}return p=b,b};for(let m of u){if(m.symbol_id===r.symbolId)continue;let b=i.get(m.symbol_id);if(!b)continue;if(!(m.start_line>=r.startLine&&m.end_line<=r.endLine)){if(!(m.start_line<=r.endLine&&m.end_line>=r.startLine))continue;let _=L(b.symbol);if(!_||!g().has(_))continue}let R=`${b.symbol}|${m.chunk_id}`;d.has(R)||(d.add(R),f.push({...b,chunkId:m.chunk_id}))}l.set(r.symbolId,f)}return l}function jt(e,t,n={}){let s=new Map;if(t&&t.length===0)return s;let o=e.all(`SELECT relative_path FROM documents
|
|
77
|
-
WHERE 1 = 1 ${e.pathExclusionsFor("documents")}`),i=pe(e),a=t??k(e),l=new Set(a.map(c=>c.symbolId));return ut(e,s,o,i,l),dt(e,s,a,l),gt(e,s,o,i,l),n.semantic!==!1&&_t(s,Y(e,bt(a))),s}function ut(e,t,n,s,o){for(let i of n){if(!y(i.relative_path)||e.isIgnored(i.relative_path))continue;let a=C(e,i.relative_path);if(a)for(let l of a){let c=de(i.relative_path,s.get(l.calleeLeaf)??[]);if(!c||c.length===0)continue;let r=fe(e,i.relative_path,c,l.memberAccess);r&&o.has(r.symbolId)&&r.file!==i.relative_path&&H(t,r.symbolId,i.relative_path)}}}function dt(e,t,n,s){let o=mt(n);for(let i of ft(e,s))e.isIgnored(i.relative_path)||pt(i,o.get(i.symbol_id))||H(t,i.symbol_id,i.relative_path)}function ft(e,t){if(!t)return ae(e);let n=[...t];if(n.length===0)return[];let s=[];for(let o=0;o<n.length;o+=re)s.push(...ae(e,n.slice(o,o+re)));return s}var re=750;function ae(e,t){let n=t&&t.length>0?`AND m.symbol_id IN (${t.map(()=>"?").join(",")})`:"";return e.all(`SELECT DISTINCT m.symbol_id, d.relative_path, c.document_id,
|
|
78
|
-
c.start_line AS chunk_start, c.end_line AS chunk_end
|
|
79
|
-
FROM mentions m
|
|
80
|
-
JOIN chunks c ON m.chunk_id = c.id
|
|
81
|
-
JOIN documents d ON c.document_id = d.id
|
|
82
|
-
WHERE m.role != 1
|
|
83
|
-
${n}
|
|
84
|
-
${e.pathExclusionsFor("d")}`,...t??[])}function mt(e){let t=new Map;for(let n of e)t.set(n.symbolId,{docId:n.documentId,startLine:n.startLine,endLine:n.endLine});return t}function pt(e,t){return!!t&&t.docId===e.document_id&&e.chunk_start>=t.startLine&&e.chunk_end<=t.endLine}function gt(e,t,n,s,o){for(let i of n){if(e.isIgnored(i.relative_path)||y(i.relative_path)!=="rust")continue;let a=te(e,i.relative_path);if(a.size!==0)for(let l of a){let c=s.get(l);if(c)for(let r of c)o.has(r.symbolId)&&r.file!==i.relative_path&&H(t,r.symbolId,i.relative_path)}}}function H(e,t,n){let s=e.get(t);s||(s=new Set,e.set(t,s)),s.add(n)}function bt(e){return e.filter(t=>"relativePath"in t&&"symbol"in t&&"leaf"in t)}function yt(e){let t=new Map;for(let[n,s]of e){let o=[];for(let i of s)o.push({symbol:i.symbol,file:i.file,chunkId:-1});t.set(n,o)}return t}function _t(e,t){for(let[n,s]of t){let o=e.get(n);o||(o=new Set,e.set(n,o));for(let i of s)o.add(i)}}export{St as a,te as b,Et as c,ie as d,xt as e,F as f,At as g,Nt as h,Jt as i,Gt as j,Wt as k,Bt as l,qe as m,ue as n,pe as o,jt as p};
|
|
85
|
-
//# sourceMappingURL=chunk-EHEZLULQ.js.map
|
package/dist/chunk-FVH3Y44U.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
//# sourceMappingURL=chunk-FVH3Y44U.js.map
|
package/dist/chunk-GWBRU65E.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as b}from"./chunk-LNUZWWWL.js";import{h as y,l as g,s as m,w as p}from"./chunk-NLJCXHFU.js";function C(n,t,s,o){let i=y(t);if(!i)return!0;let r=g(n,t);if(!r)return!0;let l=x.get(r);return l||(l=L(r,i),x.set(r,l)),l.get(`${s}:${o}`)??!0}var x=new WeakMap;function L(n,t){let s=t==="rust"?new Set(["function_item","function_signature_item"]):t==="python"?new Set(["function_definition"]):new Set(["function_declaration","method_definition","arrow_function","function_expression"]),o=new Map,i=r=>{s.has(r.type)&&o.set(`${r.startPosition.row}:${r.endPosition.row}`,_(r,t));for(let l of r.children)i(l)};return i(n.rootNode),o}function _(n,t){let s=n.namedChildren.find(e=>e.type==="block"||e.type==="statement_block");if(!s)return!1;let o=s.namedChildren.filter(e=>e.type!=="comment"&&e.type!=="line_comment"&&e.type!=="block_comment");if(o.length!==1)return!1;let i=o[0],r=null;if(i.type==="return_statement"||i.type==="expression_statement"?r=i.namedChild(0)??null:t==="rust"&&(i.type==="call_expression"||i.type==="macro_invocation")&&(r=i),!r)return!1;let l=t==="python"?"call":"call_expression";if(r.type!==l)return!1;let u=r.namedChildren.find(e=>e.type==="arguments"||e.type==="argument_list");if(!u)return!1;let d=u.namedChildren.filter(e=>e.type!=="comment"),c=n.namedChildren.find(e=>e.type==="parameters"||e.type==="formal_parameters");if(!c)return!1;let a=[];for(let e of c.namedChildren)if(e.type==="identifier")a.push(e.text);else{let f=e.namedChildren.find(S=>S.type==="identifier");f&&a.push(f.text)}if(d.length!==a.length)return!1;for(let e=0;e<a.length;e+=1){let f=d[e];if(f.type!=="identifier"||f.text!==a[e])return!1}return!0}function j(n,t){let{scope:s,maxLoc:o=15,limit:i=30,scanLimit:r}=t??{},l=new b(n),u=D(w(l,s,o).sort((a,e)=>h(a)-h(e)||a.relativePath.localeCompare(e.relativePath)),r),d=l.calleeMap(u,{semantic:t?.semantic!==!1}),c=[];for(let a of u){let e=P(n,a,d.get(a.symbolId)??[]);e&&c.push(e)}return c.sort((a,e)=>a.loc-e.loc||a.file.localeCompare(e.file)),c.slice(0,i)}function P(n,t,s){let o=T(s);if(o.size!==1||!C(n,t.relativePath,t.startLine,t.endLine))return null;let[,i]=[...o.entries()][0];return{symbol:t.symbol,shortName:m(t.symbol),file:t.relativePath,startLine:t.startLine,endLine:t.endLine,loc:h(t),forwardsTo:i.symbol,forwardsToShort:m(i.symbol),forwardsToFile:i.file}}function T(n){let t=n.some(o=>p(o.symbol))?n.filter(o=>p(o.symbol)):n,s=new Map;for(let o of t)s.has(o.symbol)||s.set(o.symbol,o);return s}function w(n,t,s){return n.productionCallableDefinitions({scope:t,minLoc:3,maxLoc:s,requireFunctionLikeSymbol:!0,excludeRustTraitImplMembers:!0})}function h(n){return n.endLine-n.startLine+1}function D(n,t){return typeof t!="number"||t<=0||n.length<=t?n:n.slice(0,t)}export{j as a};
|
|
2
|
-
//# sourceMappingURL=chunk-GWBRU65E.js.map
|
package/dist/chunk-H4DXD2FB.js
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import{execFileSync as n}from"child_process";import{platform as o,arch as p}from"os";var a=o()==="win32",u="v0.7.0";function t(e){let r=a?"where":"which";try{return n(r,[e],{stdio:"pipe"}),!0}catch{return!1}}function h(){try{return n(a?"where":"which",["scip"],{stdio:"pipe"}),!0}catch{return!1}}function w(){try{return n("scip",["--version"],{stdio:"pipe"}).toString().trim()}catch{return null}}function g(){let e=o(),r=p(),i,l,s;switch(e){case"darwin":i="darwin",s="tar.gz";break;case"linux":i="linux",s="tar.gz";break;case"win32":i="windows",s="zip";break;default:return null}switch(r){case"arm64":l="arm64";break;case"x64":l="amd64";break;default:return null}let c=`scip-${i}-${l}.${s}`;return{url:`https://github.com/sourcegraph/scip/releases/download/${u}/${c}`,filename:c}}function b(){let e=g();console.log("\nThe `scip` CLI is required but not found on PATH.\n"),o()==="darwin"?(console.log("Install via Homebrew:"),console.log(` brew install sourcegraph/scip/scip
|
|
2
|
-
`),console.log("Or download manually:")):console.log("Download from:"),console.log(e?` ${e.url}
|
|
3
|
-
`:` https://github.com/sourcegraph/scip/releases/tag/${u}
|
|
4
|
-
`),console.log("After installing, ensure `scip` is on your PATH and run `scip-query reindex`.")}function I(e){if(o()==="darwin"&&t("brew")){e("Installing scip CLI via Homebrew...");try{if(n("brew",["install","sourcegraph/scip/scip"],{stdio:"inherit",timeout:3e5,env:process.env}),t("scip"))return e("Successfully installed scip CLI via Homebrew"),!0}catch(r){let i=r instanceof Error?r.message:String(r);e(`Homebrew install failed: ${i}`)}}if(t("go")){e("Installing scip CLI via go install...");try{if(n("go",["install","github.com/sourcegraph/scip/cmd/scip@latest"],{stdio:"inherit",timeout:3e5,env:process.env}),t("scip"))return e("Successfully installed scip CLI via go install"),!0}catch(r){let i=r instanceof Error?r.message:String(r);e(`go install failed: ${i}`)}}return e("Could not auto-install scip CLI."),e("Install manually from: https://github.com/sourcegraph/scip/releases"),!1}export{h as a,w as b,b as c,I as d};
|
|
5
|
-
//# sourceMappingURL=chunk-H4DXD2FB.js.map
|
package/dist/chunk-I2KUHGMX.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import{a as h}from"./chunk-LNUZWWWL.js";import{q as p}from"./chunk-67OMD56K.js";import{s as u,v as m,x as g}from"./chunk-NLJCXHFU.js";import{execFileSync as d}from"child_process";function O(e,n={}){let t=b(e,n);return t.note?C(t.note,t.changedFileLines):t.changedFiles.length===0?D(t.changedFileLines):I(t.changedFiles,[S(e,t.changedFiles,t.changedFiles)])}function b(e,n={}){let{base:t="HEAD"}=n;try{let s=F(e.config.projectRoot,t);return{changedFileLines:s,changedFiles:_(e,s),note:s.length===0?"No changed files found.":void 0}}catch{return{changedFileLines:[],changedFiles:[],note:"Unable to compute git diff."}}}function S(e,n,t){let s=new h(e),r=new Set(t),a=[],l=new Map,o=n.flatMap(i=>s.definitionsForFile(i)).filter(N).sort((i,f)=>i.relativePath.localeCompare(f.relativePath)||i.startLine-f.startLine),c=p(e,o);for(let i of o)R(e,i,t,r,a,l,c.get(i.symbolId)??new Set);return{changedSymbols:a,consumerEntries:[...l.entries()].map(([i,f])=>({file:i,symbols:[...f].sort()}))}}function I(e,n){let t=new Map,s=n.flatMap(a=>a.changedSymbols);for(let a of n)for(let l of a.consumerEntries){let o=t.get(l.file);o||(o=new Set,t.set(l.file,o));for(let c of l.symbols)o.add(c)}let r=E(t);return{changedFiles:[...e],changedSymbols:s,affectedConsumers:r,summary:{totalChangedFiles:e.length,totalChangedSymbols:s.length,totalAffectedFiles:r.length}}}function C(e,n=[]){return{changedFiles:n,changedSymbols:[],affectedConsumers:[],summary:{totalChangedFiles:n.length,totalChangedSymbols:0,totalAffectedFiles:0,note:e}}}function D(e){return{changedFiles:e,changedSymbols:[],affectedConsumers:[],summary:{totalChangedFiles:e.length,totalChangedSymbols:0,totalAffectedFiles:0,note:"Changed files are not present in the current SCIP index."}}}function F(e,n){let t=d("git",["diff","--name-only",n],{encoding:"utf-8",cwd:e,timeout:1e4}),s=d("git",["diff","--name-only","--cached",n],{encoding:"utf-8",cwd:e,timeout:1e4}),r=d("git",["ls-files","--others","--exclude-standard"],{encoding:"utf-8",cwd:e,timeout:1e4});return[...new Set([t,s,r].flatMap(a=>a.split(`
|
|
2
|
-
`)).map(a=>a.trim()).filter(a=>a.length>0))]}function _(e,n){let t=[];for(let s of n){let r=e.get(`SELECT relative_path FROM documents
|
|
3
|
-
WHERE relative_path LIKE ?
|
|
4
|
-
LIMIT 1`,`%${s}`);r&&!e.isIgnored(r.relative_path)&&t.push(r.relative_path)}return t}function R(e,n,t,s,r,a,l){let o=Math.max(x(e,n.symbolId),l.size);if(!v(n,o))return;let c=u(n.symbol);r.push({symbol:n.symbol,shortName:c,file:n.relativePath,fanIn:o});for(let i of M(e,n.symbolId,t))y(e,s,a,i,c);for(let i of l)y(e,s,a,i,c)}function x(e,n){return e.get(`SELECT COUNT(DISTINCT c.document_id) AS fan_in
|
|
5
|
-
FROM mentions m
|
|
6
|
-
JOIN chunks c ON m.chunk_id = c.id
|
|
7
|
-
WHERE m.symbol_id = ?
|
|
8
|
-
AND m.role != 1`,n)?.fan_in??0}function M(e,n,t){return t.length===0?[]:e.all(`SELECT DISTINCT ref_d.relative_path
|
|
9
|
-
FROM mentions m
|
|
10
|
-
JOIN chunks c ON m.chunk_id = c.id
|
|
11
|
-
JOIN documents ref_d ON c.document_id = ref_d.id
|
|
12
|
-
WHERE m.symbol_id = ?
|
|
13
|
-
AND m.role != 1
|
|
14
|
-
AND ref_d.relative_path NOT IN (${t.map(()=>"?").join(",")})
|
|
15
|
-
${e.pathExclusionsFor("ref_d")}`,n,...t).map(r=>r.relative_path)}function y(e,n,t,s,r){if(e.isIgnored(s)||n.has(s))return;let a=t.get(s);a||(a=new Set,t.set(s,a)),a.add(r)}function E(e){return[...e.entries()].map(([n,t])=>({file:n,consumedSymbols:t.size})).sort((n,t)=>t.consumedSymbols-n.consumedSymbols)}function N(e){return!(g(e.symbol)||e.parentTypeName!==null&&!m(e.symbol))}function v(e,n){return m(e.symbol)||e.isTypeLike?!0:e.parentTypeName===null&&n>0}export{O as a,b,S as c,I as d};
|
|
16
|
-
//# sourceMappingURL=chunk-I2KUHGMX.js.map
|
package/dist/chunk-JMASYYSW.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{c as p}from"./chunk-5IRX5I64.js";import{d as b,e as S,o as u}from"./chunk-EHEZLULQ.js";import{g as y}from"./chunk-33Z6HQBX.js";import{p as L}from"./chunk-67OMD56K.js";import{c as x}from"./chunk-BT36WY5B.js";import{F as I,J as R,d,t as h}from"./chunk-NLJCXHFU.js";function g(t,c,o){let e=u(t).get(o);if(!e||e.length===0)return[];if(e.length===1)return[m(e[0])];let s=e.filter(r=>r.file===c);if(s.length>0)return s.map(m);let n=F(t,c),i=n.get(o);if(i)for(let r of i){let f=e.filter(l=>w(r,l.file));if(f.length>0)return f.map(m)}let a=new Set;for(let r of n.values())for(let f of r)a.add(f);for(let r of a){let f=e.filter(l=>w(r,l.file));if(f.length>0&&f.length===e.length)return f.map(m)}return[]}function C(t,c,o){let e=g(t,c,o);if(e.length>0)return e;let s=u(t).get(o);return!s||s.length===0?[]:s.map(m)}function E(t,c,o={}){let e=x(t,c);if(!e)return[];let s=h(e.symbol);if(!s)return[];if(o.semantic!==!1){let i=L(t,{...e,leaf:s,parentTypeName:null,isFunctionLike:!1,isTypeLike:!1,kind:null,documentation:null,enclosingSymbol:null});if(i.length>0){let a=new Map;for(let r of i){let f=a.get(r.file)??[];f.push(r.line),a.set(r.file,f)}return D(t,a)}}let n=new Map;for(let i of p(t)){let a=d(t,i);if(!a||a.indexOf(s)===-1||i!==e.relativePath&&!g(t,i,s).some(l=>l.symbolId===e.symbolId))continue;let r=b(t,i,s,i===e.relativePath?{excludeStartLine:e.startLine,excludeEndLine:e.endLine}:{});r.length>0&&n.set(i,r)}return D(t,n)}function A(t,c){let o=new Map;for(let n of c){if(!n.leaf)continue;let i=o.get(n.leaf)??[];i.push(n),o.set(n.leaf,i)}if(o.size===0)return new Map;let e=new Set(c.map(n=>n.symbolId)),s=new Map;for(let n of p(t)){let i=S(t,n);if(i.size!==0){for(let a of i)if(o.has(a))for(let r of g(t,n,a)){if(!e.has(r.symbolId)||n===r.relativePath)continue;let f=s.get(r.symbolId);f||(f=new Set,s.set(r.symbolId,f)),f.add(n)}}}return s}function F(t,c){let o=new Map;for(let e of y(t,c)){if(!e.sourcePath)continue;let s=e.localName??e.importedName;if(s){let n=o.get(s);n||(n=new Set,o.set(s,n)),n.add(e.sourcePath)}if(e.kind==="namespace")for(let n of e.usedMembers){let i=o.get(n);i||(i=new Set,o.set(n,i)),i.add(e.sourcePath)}}return o}function w(t,c){let o=e=>e.replace(/\\/g,"/").replace(/^\.\//,"");return o(t)===o(c)}function m(t){return{symbolId:t.symbolId,symbol:t.symbol,relativePath:t.file}}function D(t,c){let o=[],e=new Set;for(let[s,n]of c){let i=I(t,s);for(let a of n){let r=R(i,a),f=`${s}|${a}|${r?.symbol??""}`;e.has(f)||(e.add(f),o.push({file:s,line:a,enclosingSymbol:r?.symbol??null}))}}return o}export{g as a,C as b,E as c,A as d};
|
|
2
|
-
//# sourceMappingURL=chunk-JMASYYSW.js.map
|
package/dist/chunk-KAM4C6ZD.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
function i(e){return/[*?]/.test(e)?e.replace(/\*\*/g,"%").replace(/\*/g,"%").replace(/\?/g,"_"):`%${e}%`}function l(e,r){let a=i(r);return e.all(`SELECT relative_path FROM documents
|
|
2
|
-
WHERE relative_path LIKE ?
|
|
3
|
-
ORDER BY relative_path`,a).filter(t=>!e.isIgnored(t.relative_path)).map(t=>({relativePath:t.relative_path}))}export{l as a};
|
|
4
|
-
//# sourceMappingURL=chunk-KAM4C6ZD.js.map
|
package/dist/chunk-LBWLO7NA.js
DELETED
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import{a as m}from"./chunk-LNUZWWWL.js";import{c as u}from"./chunk-IIKNAXAE.js";import{g as l,h as a}from"./chunk-33Z6HQBX.js";import{s as d,u as c}from"./chunk-NLJCXHFU.js";function C(e,t={}){let{scope:o,limit:r}=t,n=new m(e),i=x([...p(e,o),...f(e,n,o)]);return N(i),r?i.slice(0,r):i}function p(e,t){let o=[];for(let r of R(e,t)){if(e.isIgnored(r.barrel_path)||e.isIgnored(r.original_path)||u(e,r.barrel_path))continue;let n=b(e,r),i=n?.barrel_consumers??0,s=n?.direct_consumers??0;i!==0||s!==0||o.push({barrelFile:r.barrel_path,symbol:r.symbol,shortName:d(r.symbol),originalFile:r.original_path,barrelConsumers:i,directConsumers:s})}return o}function R(e,t){let o=t?`AND barrel_d.relative_path LIKE '%${t}%'`:"";return 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
|
-
${o}
|
|
31
|
-
ORDER BY barrel_d.relative_path, gs.symbol`)}function b(e,t){return 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
|
-
)`,t.barrel_doc_id,t.symbol_id,t.barrel_doc_id,t.original_doc_id)}function f(e,t,o){let r=[];for(let n of E(e,o))_(e,n,n)>0||r.push(...h(e,t,n));return r}function E(e,t){return e.all(`SELECT relative_path
|
|
61
|
-
FROM documents
|
|
62
|
-
WHERE 1 = 1
|
|
63
|
-
${t?"AND relative_path LIKE ?":""}
|
|
64
|
-
${e.pathExclusionsFor("documents")}
|
|
65
|
-
ORDER BY relative_path`,...t?[`%${t}%`]:[]).map(r=>r.relative_path).filter(r=>!e.isIgnored(r)).filter(r=>a(e,r).length>0)}function h(e,t,o){return a(e,o).filter(r=>r.sourcePath&&!e.isIgnored(r.sourcePath)).flatMap(r=>g(e,t,o,r.sourcePath))}function g(e,t,o,r){let n=S(t,r);return n?[{barrelFile:o,symbol:n.symbol,shortName:d(n.symbol),originalFile:r,barrelConsumers:0,directConsumers:_(e,r,o)}]:[]}function _(e,t,o){let r=e.all(`SELECT relative_path
|
|
66
|
-
FROM documents
|
|
67
|
-
WHERE 1 = 1
|
|
68
|
-
${e.pathExclusionsFor("documents")}
|
|
69
|
-
ORDER BY relative_path`),n=new Set;for(let i of r)if(!(e.isIgnored(i.relative_path)||i.relative_path===o))for(let s of l(e,i.relative_path))s.sourcePath===t&&n.add(i.relative_path);return n.size}function S(e,t){let o=e.definitionsForFile(t);return o.find(r=>c(r.symbol)==="method")??o[0]??null}function x(e){let t=new Set,o=[];for(let r of e){let n=`${r.barrelFile}|${r.symbol}|${r.originalFile}`;t.has(n)||(t.add(n),o.push(r))}return o}function N(e){e.sort((t,o)=>o.directConsumers-t.directConsumers||t.barrelFile.localeCompare(o.barrelFile)||t.shortName.localeCompare(o.shortName))}export{C as a};
|
|
70
|
-
//# sourceMappingURL=chunk-LBWLO7NA.js.map
|
package/dist/chunk-LJ2YWNQF.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
function t(e){let r=e.replace(/\\/g,"/").split("/").filter(Boolean);return r.length<=1?"(root)":r.length>=3&&["src","lib","app","server","client"].includes(r[0])?`${r[0]}/${r[1]}`:r[0]}function l(e,n){if(e===n)return"ok";let r=s(e),o=s(n);return r&&o?i(r,o)?"ok":"violation":a(e,n)}function c(e,n){let r=s(t(e)),o=s(t(n));return!!r&&!!o}function s(e){return/^src\/([^/]+)$/.exec(e)?.[1]??null}function i(e,n){return n==="domain"?!0:e==="domain"?!1:{analysis:new Set(["domain","source","storage","symbols"]),core:new Set(["analysis","domain","resolution","source","storage","symbols"]),"language-parsers":new Set(["domain","resolution","source","storage"]),queries:new Set(["analysis","core","domain","language-parsers","resolution","semantic","source","storage","symbols"]),reindex:new Set(["domain","language-parsers","resolution","runtime","source","storage","symbols"]),resolution:new Set(["domain","source","storage","symbols"]),runtime:new Set(["domain","queries","reindex","resolution","source","storage","symbols"]),semantic:new Set(["domain","resolution","storage","symbols"]),source:new Set(["domain","storage"]),storage:new Set(["domain","source"]),symbols:new Set(["analysis","domain","language-parsers","resolution","semantic","source","storage"])}[e]?.has(n)??!1}function a(e,n){if(n==="shared")return"ok";let r={app:new Set(["core","shared","ui"]),core:new Set(["shared"]),infra:new Set(["core","shared"]),ui:new Set(["core","shared"])};return r[e]?r[e].has(n)?"ok":"violation":null}export{t as a,l as b,c};
|
|
2
|
-
//# sourceMappingURL=chunk-LJ2YWNQF.js.map
|
package/dist/chunk-LLDPR3DG.js
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import{a as p}from"./chunk-BT36WY5B.js";import{existsSync as f}from"fs";import{basename as u,isAbsolute as g,join as d}from"path";function S(t,o){let e=h(t,o,{allowMultiple:!1})[0]?.relativePath;return e||v(t,o)}function b(t,o){return h(t,o,{allowMultiple:!0}).map(e=>e.relativePath)}function v(t,o){if(!o)return null;let e=o.replace(/\\/g,"/").replace(/^\.\//,""),i=g(e)&&e.startsWith(t.config.projectRoot)?e.slice(t.config.projectRoot.length).replace(/^\/+/,""):e,n=d(t.config.projectRoot,i);return f(n)?i:null}function h(t,o,e){let i=m(o);if(!i)return[];let a=t.all(`SELECT relative_path
|
|
2
|
-
FROM documents
|
|
3
|
-
WHERE 1 = 1
|
|
4
|
-
${t.pathExclusionsFor("documents")}
|
|
5
|
-
ORDER BY relative_path`).filter(r=>!t.isIgnored(r.relative_path)).map(r=>({relativePath:r.relative_path,score:x(r.relative_path,i)})).filter(r=>r.score>0).sort((r,c)=>c.score-r.score||r.relativePath.localeCompare(c.relativePath));if(a.length===0){let r=p(t,o);return!r||t.isIgnored(r.relativePath)?[]:[{relativePath:r.relativePath,score:700}]}let s=a.filter(r=>r.score>=1100);if(s.length>0)return e.allowMultiple?s:[s[0]];let l=a.filter(r=>r.score>=800);return l.length>0?e.allowMultiple?l:[l[0]]:e.allowMultiple?a:[a[0]]}function x(t,o){let e=m(t),i=u(e),n=u(o),a=0;return e===o&&(a+=1200),e.endsWith(`/${o}`)&&(a+=1100),i===n&&(a+=900),e.startsWith(`${o}/`)&&(a+=850),e.includes(o)&&(a+=250),a}function m(t){return t.trim().replace(/\\/g,"/").replace(/^\.\//,"").replace(/^\/+/,"").replace(/\/+$/,"")}export{S as a,b};
|
|
6
|
-
//# sourceMappingURL=chunk-LLDPR3DG.js.map
|
package/dist/chunk-LNUZWWWL.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as b,e as A}from"./chunk-IIKNAXAE.js";import{a as p,b as O,d as E}from"./chunk-JMASYYSW.js";import{c as q}from"./chunk-5IRX5I64.js";import{b as F,c as L,f as D,j as M,n as N,p as v}from"./chunk-EHEZLULQ.js";import{F as P,H as T,g as m,h as g,i as h,p as R,v as C,w as I,y as x,z as k}from"./chunk-NLJCXHFU.js";function V(i,e,r){let c=e.identifierResolution==="strict"?p:O;for(let n of e.paths){let l=g(n);if(!l&&!(e.includeVueSfc&&h(n))||i.isIgnored(n)||e.skipPath?.(n))continue;let u=D(i,n);for(let[t,a]of u)if(!(e.candidateNames&&!e.candidateNames.has(t)))for(let f of c(i,n,t))r({sourceFile:n,name:t,target:f,occurrences:a.length,kind:"identifier"});if(e.includeCrossLanguageDispatchNames){for(let t of L(i,n))if(!(e.candidateNames&&!e.candidateNames.has(t)))for(let a of p(i,n,t))r({sourceFile:n,name:t,target:a,occurrences:1,kind:"cross-language-dispatch"})}if(e.includeRustAttributeNames&&l==="rust"){for(let t of F(i,n))if(!(e.candidateNames&&!e.candidateNames.has(t)))for(let a of c(i,n,t))r({sourceFile:n,name:t,target:a,occurrences:1,kind:"rust-attribute"})}}}var G=class{constructor(e){this.db=e}db;scopedDefinitions(e){return T(this.db,e)}definitionsForFile(e){return P(this.db,e)}productionCallableDefinitions(e={}){let{scope:r,minLoc:c=1,maxLoc:n=Number.POSITIVE_INFINITY,excludeSymbol:l,excludeEntrySurfaces:u=!1,excludeTypesFiles:t=!1,requireFunctionLikeSymbol:a=!1,requireCallableSymbol:f=!1,excludeRustTraitImplMembers:K=!1,includeSuppressed:j=!1,sortByLocDesc:B=!1}=e,d=[];for(let o of this.scopedDefinitions(r)){let s=o.relativePath;if(this.db.isIgnored(s)||u&&A(this.db,s)||!H(o,{requireFunctionLikeSymbol:a,requireCallableSymbol:f})||l!==void 0&&o.symbol===l)continue;let S=y(o);S<c||S>n||t&&Y(s)||K&&x(o.symbol)||b(s)!=="test"&&(k(o.symbol)||!j&&m(this.db,s,o.startLine)||d.push(o))}return B?d.sort((o,s)=>y(s)-y(o)):d}calleeMap(e,r={}){return N(this.db,e,r)}crossFileCallerMap(e,r={}){return v(this.db,e,r)}sourceFallbackCallerFiles(e){return E(this.db,e)}fileDependencyGraph(e){return M(this.db,e)}fileKind(e){return b(e)}hasSuppressionComment(e){return m(this.db,e.relativePath,e.startLine)}sourceFiles(){return q(this.db)}scanSourceReferences(e,r){V(this.db,e,r)}callableSignature(e){return R(this.db,e.relativePath,e.startLine,e.endLine)}};function y(i){return i.endLine-i.startLine+1}function H(i,e){return e.requireCallableSymbol?C(i.symbol):e.requireFunctionLikeSymbol?I(i.symbol):i.isFunctionLike}function Y(i){return(i.split("/").pop()??"").includes("types")}export{G as a};
|
|
2
|
-
//# sourceMappingURL=chunk-LNUZWWWL.js.map
|
package/dist/chunk-NLJCXHFU.js
DELETED
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
function h(e){let n=new WeakMap,t=r=>{let i=n.get(r);return i||(i=new Map,n.set(r,i)),i};return{get(r,i,a){let s=t(r);if(s.has(i))return s.get(i);let c=a();return s.set(i,c),c},invalidate(r,i){n.get(r)?.delete(i)},invalidateAll(r){n.delete(r)},size(r){return n.get(r)?.size??0}}}function $e(e){let n=new WeakMap;return{get(t,r){let i=n.get(t);if(i)return i.value;let a=r();return n.set(t,{value:a}),a},invalidate(t){n.delete(t)},has(t){return n.has(t)}}}function M(e){let n=new WeakMap,t=r=>{let i=n.get(r);return i||(i=new Map,n.set(r,i)),i};return{get(r,i,a,s){let c=t(r),o=c.get(i);if(o&&o.source===a)return o.value;let l=s();return c.set(i,{source:a,value:l}),l},invalidate(r,i){n.get(r)?.delete(i)},invalidateAll(r){n.delete(r)}}}import{existsSync as q,readFileSync as J}from"fs";import{join as X}from"path";var D=h("source-text");function m(e,n){let t=n.replace(/\\/g,"/");return D.get(e,t,()=>{let r=X(e.config.projectRoot,t);return q(r)?J(r,"utf-8"):""})}function Be(e){D.invalidateAll(e)}function He(e,n){D.invalidate(e,n.replace(/\\/g,"/"))}var Z=/scip-query[\s:-]*ignore[\s:-]*(?:dead(?:-code)?|stale|wrapper|passthrough|drift|extract)?/i;function ze(e,n,t){if(t<=0)return!1;let r=m(e,n);if(!r)return!1;let i=r.split(`
|
|
2
|
-
`);for(let a=t-1;a>=0&&a>=t-5;a-=1){let s=(i[a]??"").trim();if(s!==""){if(Z.test(s))return!0;if(!s.startsWith("//")&&!s.startsWith("*")&&!s.startsWith("/*")&&!s.startsWith("@")&&!s.startsWith("#"))return!1}}return!1}import{extname as E}from"path";import{createRequire as ee}from"module";var f=ee(import.meta.url),x=null,w=!1;function P(){if(w)return null;if(x)return x;try{return x=f("tree-sitter"),x}catch{return w=!0,null}}var te={".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"},R=new Map,C=new Set;function F(e){if(C.has(e))return null;let n=R.get(e);if(n)return n;let t;try{switch(e){case"rust":t=f("tree-sitter-rust");break;case"typescript":t=f("tree-sitter-typescript").typescript;break;case"tsx":t=f("tree-sitter-typescript").tsx;break;case"javascript":t=f("tree-sitter-javascript");break;case"python":t=f("tree-sitter-python");break;case"java":t=f("tree-sitter-java");break;case"kotlin":t=f("tree-sitter-kotlin");break;case"scala":t=f("tree-sitter-scala");break;case"ruby":t=f("tree-sitter-ruby");break;case"c":t=f("tree-sitter-c");break;case"cpp":t=f("tree-sitter-cpp");break;case"csharp":t=f("tree-sitter-c-sharp");break;case"php":t=f("tree-sitter-php").php;break;case"vb":{let r=f("tree-sitter-vb-dotnet");t=r.language??r;break}}}catch{return C.add(e),null}return R.set(e,t),t}var N=new Map;function O(e){let n=N.get(e);if(n)return n;let t=F(e);if(!t)return null;let r=P();if(!r)return null;let i=new r;try{i.setLanguage(t)}catch{return C.add(e),null}return N.set(e,i),i}function S(e){return te[E(e).toLowerCase()]??null}function ne(e){return E(e).toLowerCase()===".vue"}var _=M("ast-trees");function Je(e){_.invalidateAll(e)}function Xe(e,n){_.invalidate(e,n)}function k(e,n){if(ne(n))return re(e,n);let t=S(n);if(!t)return null;let r=m(e,n);return r?_.get(e,n,r,()=>{let i=O(t);if(!i)return null;try{return $(i,r)}catch{return null}}):null}function re(e,n){let t=m(e,n);return t?_.get(e,n,t,()=>{let r=ie(t);if(!r)return null;let i=O(r.language);if(!i)return null;let a=`
|
|
3
|
-
`.repeat(r.startLine)+r.body;try{return $(i,a)}catch{return null}}):null}function $(e,n){return e.parse(r=>r>=n.length?null:n.slice(r,Math.min(n.length,r+16384)))}function ie(e){let n=[],t=/<script\b([^>]*)>([\s\S]*?)<\/script>/g;for(let o of e.matchAll(t))typeof o.index=="number"&&n.push({tagOpen:o[1]??"",body:o[2]??"",openIdx:o.index+(o[0].length-(o[2]?.length??0)-9)});if(n.length===0)return null;let r=n.find(o=>/\bsetup\b/.test(o.tagOpen))??n[0],a=r.tagOpen.match(/\blang\s*=\s*["']?([\w-]+)/)?.[1]?.toLowerCase(),s=a==="ts"||a==="typescript"?"typescript":a==="tsx"?"tsx":"javascript",c=ae(e,r.openIdx);return{body:r.body,startLine:c,language:s}}function ae(e,n){let t=0;for(let r=0;r<n&&r<e.length;r++)e.charCodeAt(r)===10&&t++;return t}var g=new Map;function se(e,n){let t=`${e}::${n}`;if(g.has(t))return g.get(t)??null;let r=F(e);if(!r)return g.set(t,null),null;let i=P();if(!i)return g.set(t,null),null;try{let a=new i.Query(r,n);return g.set(t,a),a}catch{return g.set(t,null),null}}var oe={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
|
-
`},ce=new WeakMap;function j(e,n){return Q(e,n,ce,oe,t=>{let r=[];for(let i of t){let a=null,s=null;for(let c of i.captures)c.name==="name"?a=c.node.text:c.name==="def"&&(s={startLine:c.node.startPosition.row,endLine:c.node.endPosition.row});a&&s&&r.push({name:a,startLine:s.startLine,endLine:s.endLine})}return r})}var le={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
|
-
`},ue=new WeakMap;function Ze(e,n){return Q(e,n,ue,le,t=>{let r=[];for(let i of t){let a=null,s=null;for(let o of i.captures)o.name==="target"?a=o.node:o.name==="call"&&(s=o.node);if(!a||!s)continue;let c=v(a);c&&r.push({calleeLeaf:c,memberAccess:de(a),line:s.startPosition.row})}return r})}function de(e){switch(e.type){case"field_expression":case"member_expression":case"attribute":return!0;default:return!1}}function et(e,n){return fe(e,n,pe,()=>new Map,(t,r,i)=>{let a=(o,l)=>{if(o===l)return;let u=i.get(o);u||(u=new Set,i.set(o,u)),u.add(l)},s=r==="python"?new Set(["identifier"]):new Set(["type_identifier"]),c=(o,l)=>{let u=d=>{s.has(d.type)&&d.text!==l&&a(d.text,l);for(let y of d.children)u(y)};for(let d of o.children)u(d)};if(r==="rust")for(let o of t.rootNode.descendantsOfType(["struct_item","enum_item","union_item","type_item"])){let l=o.namedChildren.find(d=>d.type==="type_identifier")?.text;if(!l)continue;let u=o.namedChildren.find(d=>d.type==="field_declaration_list"||d.type==="enum_variant_list"||d.type==="ordered_field_declaration_list");u&&c(u,l),o.type==="type_item"&&c(o,l)}else if(r==="python")for(let o of t.rootNode.descendantsOfType("class_definition")){let l=o.namedChildren.find(d=>d.type==="identifier")?.text;if(!l)continue;let u=o.namedChildren.find(d=>d.type==="block");if(u)for(let d of u.descendantsOfType("type"))for(let y of d.descendantsOfType("identifier"))y.text!==l&&a(y.text,l)}else for(let o of t.rootNode.descendantsOfType(["interface_declaration","type_alias_declaration","class_declaration"])){let l=o.namedChildren.find(u=>u.type==="type_identifier")?.text;l&&c(o,l)}})??new Map}function fe(e,n,t,r,i){let a=S(n);if(!a)return null;let s=k(e,n);if(!s)return null;let c=t.get(s);if(c)return c;let o=r();return i(s,a,o),t.set(s,o),o}function Q(e,n,t,r,i){let a=S(n);if(!a)return null;let s=r[a];if(!s)return null;let c=k(e,n);if(!c)return null;let o=t.get(c);if(o)return o;let l=se(a,s);if(!l)return null;let u=i(l.matches(c.rootNode));return t.set(c,u),u}var pe=new WeakMap,T=new WeakMap;function tt(e,n,t,r){let i=S(n);if(!i)return null;let a=k(e,n);if(!a)return null;let s=T.get(a);return s||(s=me(a,i),T.set(a,s)),s.get(`${t}:${r}`)??null}function me(e,n){let t=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"]),r=new Map,i=a=>{if(t.has(a.type)){let s=a.namedChildren.find(o=>o.type==="parameters"||o.type==="formal_parameters"),c=0;if(s)for(let o of s.namedChildren)o.type==="comment"||o.type==="line_comment"||o.type==="block_comment"||(c+=1);r.set(`${a.startPosition.row}:${a.endPosition.row}`,{paramCount:c})}for(let s of a.children)i(s)};return i(e.rootNode),r}function v(e){switch(e.type){case"identifier":case"type_identifier":case"property_identifier":case"shorthand_property_identifier":return e.text;case"field_expression":case"member_expression":case"attribute":{let n=e.namedChild(e.namedChildCount-1);return n?v(n):null}case"scoped_identifier":{let n=e.childForFieldName("name")??e.namedChild(e.namedChildCount-1);return n?v(n):null}case"super":case"self":case"this":return null;default:return null}}var ge={"/":"namespace","#":"type",".":"term","[":"type-param",":":"meta","!":"macro"};function p(e){if(e.startsWith("local "))return{kind:"local",id:e.slice(6),raw:e};let n=e.split(" ");if(n.length<4)return{scheme:n[0]??"",manager:n[1]??"",packageName:n[2]??"",version:"",descriptors:[],raw:e};let t=n[0],r=n[1],i=e.slice(t.length+1+r.length+1),a;if(i.startsWith("`")){let l=i.indexOf("`",1);l===-1?(a=i.slice(1),i=""):(a=i.slice(1,l),i=i.slice(l+2))}else{let l=i.indexOf(" ");l===-1?(a=i,i=""):(a=i.slice(0,l),i=i.slice(l+1))}let s,c=i.indexOf(" ");c===-1?(s=i,i=""):(s=i.slice(0,c),i=i.slice(c+1));let o=be(i);return{scheme:t,manager:r,packageName:a,version:s,descriptors:o,raw:e}}function be(e){let n=[],t=0;for(;t<e.length;){if(e[t]==="["){let a=e.indexOf("]",t+1);if(a===-1){n.push({name:e.slice(t+1),suffix:"type-param"});break}n.push({name:e.slice(t+1,a),suffix:"type-param"}),t=a+1;continue}if(e[t]==="("&&(n.length===0||t===0||V(e[t-1]))){let a=e.indexOf(")",t+1);if(a!==-1&&e[a+1]!=="."){n.push({name:e.slice(t+1,a),suffix:"parameter"}),t=a+1;continue}}let r;if(e[t]==="`"){let a=e.indexOf("`",t+1);if(a===-1){r=e.slice(t+1),n.push({name:r,suffix:"term"});break}r=e.slice(t+1,a),t=a+1}else{let a=t;for(;t<e.length&&!V(e[t]);)t++;r=e.slice(a,t)}if(t>=e.length){r&&n.push({name:r,suffix:"term"});break}let i=e[t];if(i==="("){let a=e.indexOf(")",t+1);a!==-1&&e[a+1]==="."?(n.push({name:r,suffix:"method"}),t=a+2):a!==-1?(n.push({name:r,suffix:"method"}),t=a+1):(n.push({name:r,suffix:"term"}),t++)}else{let a=ge[i];a&&n.push({name:r,suffix:a}),t+=1}}return n}function V(e){return e==="/"||e==="#"||e==="."||e==="("||e==="["||e===":"||e==="!"}function W(e){let n=p(e);if("kind"in n&&n.kind==="local")return`local:${n.id}`;let t=n;if(t.descriptors.length===0)return t.raw;let r=[];for(let i of t.descriptors){let a=ye(i);a&&r.push(a)}return r.join(":")}function ye(e){let n=e.suffix==="namespace"?he(e.name):e.name;return n?e.suffix==="method"?`${n}()`:n:""}function he(e){return e.replace(/\.(ts|tsx|js|jsx|mjs|cjs)$/,"").replace(/\.(py|pyi)$/,"").replace(/\.(rs)$/,"").replace(/\.(java|scala|kt|kts)$/,"").replace(/\.(rb)$/,"").replace(/\.(go)$/,"").replace(/\.(cs|vb)$/,"").replace(/\.(dart)$/,"").replace(/\.(php)$/,"").replace(/\.(c|cc|cpp|cxx|h|hpp)$/,"")}function B(e){let n=p(e);if("kind"in n&&n.kind==="local")return n.id;let t=n;return t.descriptors.length===0?"":t.descriptors[t.descriptors.length-1].name}function b(e){let n=p(e);if("kind"in n&&n.kind==="local")return null;let t=n;return t.descriptors[t.descriptors.length-1]?.suffix??null}function rt(e){return e.endsWith("().")||b(e)==="method"}function H(e){let n=b(e);return n==="method"||n==="term"}function it(e){return b(e)==="namespace"}var xe=/^rust-analyzer\b.*[\s/]impl#\[[^\]]+\]\[[^\]]+\]/;function at(e){return xe.test(e)}var Se=new Set(["test","tests","_tests"]);function st(e){let n=p(e);if("kind"in n)return!1;for(let t=0;t<n.descriptors.length-1;t+=1){let r=n.descriptors[t];if(r?.suffix==="namespace"&&r.name&&Se.has(r.name))return!0}return!1}function ot(e,n){let t=p(e),r=p(n);if("kind"in t||"kind"in r)return!1;let i=t.descriptors,a=r.descriptors;if(a.length!==i.length+1)return!1;for(let s=0;s<i.length;s++){let c=i[s],o=a[s];if(c.name!==o.name||c.suffix!==o.suffix)return!1}return!0}function ct(e,n){let t=p(e),r=p(n);if("kind"in t||"kind"in r)return!1;let i=t.descriptors,a=r.descriptors;if(a.length<=i.length)return!1;for(let s=0;s<i.length;s++){let c=i[s],o=a[s];if(c.name!==o.name||c.suffix!==o.suffix)return!1}return!0}function U(e){return!e||!e.trim()?null:e.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 Y(e){if(!e)return null;let n=z(e);if(n)return n.replace(/\n/g," ");let t=e.indexOf("|");if(t===-1)return e.replace(/\n/g," ");let r=e.slice(t+1);return(z(r)??r).replace(/\n/g," ")}function z(e){return/^```(?:\w+)?\s*\n?([\s\S]*?)\n?```/.exec(e.trimStart())?.[1]?.trim()||null}var G=h("file-definitions");function bt(e,n){G.invalidate(e,n)}function I(e,n){return G.get(e,n,()=>{let t=Ce(_e(e,n),Le(e,n));return Ie(e,n,t.map(De))})}function _e(e,n){return e.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
|
-
${e.symbolNoiseFor("gs")}
|
|
59
|
-
ORDER BY der.start_line, der.end_line`,n)}function Le(e,n){return e.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
|
-
${e.symbolNoiseFor("gs")}
|
|
77
|
-
GROUP BY gs.id, gs.symbol, c.document_id, d.relative_path
|
|
78
|
-
ORDER BY start_line, end_line`,n)}function De(e){return{symbolId:e.id,symbol:e.symbol,documentId:e.document_id,startLine:e.start_line,endLine:e.end_line,relativePath:e.relative_path,leaf:B(e.symbol),parentTypeName:A(e.symbol),isFunctionLike:H(e.symbol),isTypeLike:b(e.symbol)==="type",kind:e.kind??null,documentation:e.documentation??null,enclosingSymbol:e.enclosing_symbol??null}}function Ce(e,n){let t=new Map;for(let r of n)e.length>0&&!ve(r)||t.set(r.id,r);for(let r of e)t.set(r.id,r);return[...t.values()].sort((r,i)=>r.start_line-i.start_line||r.end_line-i.end_line||r.symbol.localeCompare(i.symbol))}function ve(e){if(A(e.symbol)!==null)return!1;let t=(e.documentation??"").replace(/^```\w*\s*/,"").replace(/\s*```$/,"").trim();return/^(?:var|let|const|function|class|interface|type|enum)\b/.test(t)}function yt(e,n={}){return ke(e,n.scope)}function ke(e,n){let t=n?`AND relative_path LIKE '%${n}%'`:"";return e.all(`SELECT relative_path
|
|
79
|
-
FROM documents
|
|
80
|
-
WHERE 1 = 1
|
|
81
|
-
${e.pathExclusionsFor("documents")}
|
|
82
|
-
${t}
|
|
83
|
-
ORDER BY relative_path`).flatMap(r=>I(e,r.relative_path)).filter(r=>!e.isIgnored(r.relativePath))}function ht(e,n,t={}){if(n.length===0)return[];let r=n.flatMap(i=>I(e,i)).filter(i=>!e.isIgnored(i.relativePath));return t.onlyDocumented&&(r=r.filter(i=>i.documentation!==null&&i.documentation!=="")),t.sort&&(r=r.sort((i,a)=>i.relativePath.localeCompare(a.relativePath)||i.startLine-a.startLine||i.endLine-a.endLine)),r.map(i=>({startLine:i.startLine,endLine:i.endLine,symbol:i.symbol,shortName:W(i.symbol),signature:U(Y(i.documentation)),relativePath:i.relativePath,enclosingSymbol:i.enclosingSymbol}))}function xt(e,n){let t=null;for(let r of e)r.startLine>n||r.endLine<n||(!t||r.endLine-r.startLine<t.endLine-t.startLine)&&(t=r);return t}function St(e,n){let t=I(e,n.relative_path).find(r=>r.symbolId===n.id);return t?{symbolId:t.symbolId,symbol:t.symbol,documentId:t.documentId,startLine:t.startLine,endLine:t.endLine,relativePath:t.relativePath}:{symbolId:n.id,symbol:n.symbol,documentId:n.document_id,startLine:n.start_line,endLine:n.end_line,relativePath:n.relative_path}}function Ie(e,n,t){let r=m(e,n),i=j(e,n);return i?Te(t,i,r):r?Ae(t,r):t}function Ae(e,n){let t=n.split(/\r?\n/),r=Me(e,t),i=we(e,r),a=Re(i,t);return Ne(e,a)}function Me(e,n){let t=e.some(i=>L(i.symbol))?Pe(n):null,r=new Map;for(let i of e)r.set(i.symbolId,Ee(n,t,i));return r}function we(e,n){return e.filter(t=>L(t.symbol)).map(t=>({definition:t,startLine:n.get(t.symbolId)??t.startLine})).sort((t,r)=>t.startLine-r.startLine||t.definition.startLine-r.definition.startLine||t.definition.symbol.localeCompare(r.definition.symbol))}function Re(e,n){let t=new Map;for(let r=0;r<e.length;r+=1){let i=e[r],a=e[r+1],s=a?Math.max(i.startLine,a.startLine-1):n.length-1;t.set(i.definition.symbolId,{startLine:i.startLine,endLine:Fe(n,i.definition,i.startLine,s)})}return t}function Ne(e,n){return e.map(t=>{let r=n.get(t.symbolId);return r?{...t,startLine:r.startLine,endLine:r.endLine}:t})}function Te(e,n,t=null){let r=new Map;for(let i of n){let a=r.get(i.name);a?a.push(i):r.set(i.name,[i])}return e.map(i=>{if(!L(i.symbol)||!i.leaf)return K(i,t);let a=r.get(i.leaf);if(!a||a.length===0)return K(i,t);let s=a[0],c=Math.abs(s.startLine-i.startLine);for(let o=1;o<a.length;o+=1){let l=a[o],u=Math.abs(l.startLine-i.startLine);u<c&&(s=l,c=u)}return{...i,startLine:s.startLine,endLine:s.endLine}})}function K(e,n){if(!n||!e.leaf||b(e.symbol)!=="term"||A(e.symbol)!==null)return e;let t=e.leaf.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),r=new RegExp(`\\b(?:export\\s+)?(?:const|let|var)\\s+${t}\\b`),a=n.split(/\r?\n/).findIndex(s=>r.test(s));return a>=0?{...e,startLine:a,endLine:a}:e}function Ee(e,n,t){if(!L(t.symbol))return t.startLine;let r=Math.max(0,Math.min(t.startLine,e.length-1));if(!n)return r;let i=n.get(t.leaf);if(!i||i.length===0)return r;let a=null;for(let s of i){let c=Math.abs(s-t.startLine);(!a||c<a.distance)&&(a={line:s,distance:c})}return a?.line??r}function Pe(e){let n=/\b(?:function|def|fn)\s+([A-Za-z_$][\w$]*)/g,t=/\b([A-Za-z_$][\w$]*)\s*[:=]\s*(?:async\s*)?(?:function\b|\()/g,r=/^\s*(?:(?:export|public|private|protected|static|readonly|async|abstract|get|set)\s+)*([A-Za-z_$][\w$]*)\s*(?:<[^(]*>)?\s*\(/,i=/\b([A-Za-z_$][\w$]*)\s*\(/g,a=new Map,s=(c,o)=>{let l=a.get(c);if(!l){a.set(c,[o]);return}l[l.length-1]!==o&&l.push(o)};for(let c=0;c<e.length;c+=1){let o=e[c]??"";for(let u of o.matchAll(n))u[1]&&s(u[1],c);for(let u of o.matchAll(t))u[1]&&s(u[1],c);let l=o.match(r);l?.[1]&&s(l[1],c);for(let u of o.matchAll(i))u[1]&&s(u[1],c)}return a}function Fe(e,n,t,r){let i=Math.max(t,Math.min(e.length-1,r)),a=Math.max(t,Math.min(i,n.endLine)),s=0,c=0,o=!1;for(let l=t;l<=i;l+=1){let u=Oe(e[l]??"");for(let d of u)d==="{"?(s+=1,o=!0):d==="}"?s=Math.max(0,s-1):d==="("?c+=1:d===")"&&(c=Math.max(0,c-1));if(o&&s===0||!o&&c===0&&l>=a)return l}return a}function Oe(e){let n="",t=null,r=!1;for(let i=0;i<e.length;i+=1){let a=e[i],s=e[i+1];if(!t&&a==="/"&&s==="/"){n+=" ".repeat(e.length-i);break}if(t){if(r){r=!1,n+=" ";continue}if(a==="\\"){r=!0,n+=" ";continue}a===t&&(t=null),n+=" ";continue}if(a==='"'||a==="'"||a==="`"){t=a,n+=" ";continue}n+=a}return n}function L(e){return e.includes("().")}function A(e){let n=p(e);if("kind"in n)return null;for(let t=n.descriptors.length-2;t>=0;t--){let r=n.descriptors[t];if(r?.suffix==="type")return r.name}return null}function _t(e){let n=p(e);if("kind"in n)return[];let t=[];for(let r=n.descriptors.length-2;r>=0;r-=1){let i=n.descriptors[r];i?.suffix==="type"&&i.name&&t.push(i.name)}return t}export{h as a,$e as b,M as c,m as d,Be as e,He as f,ze as g,S as h,ne as i,Je as j,Xe as k,k as l,Ze as m,et as n,fe as o,tt as p,v as q,p as r,W as s,B as t,b as u,rt as v,H as w,it as x,at as y,st as z,ot as A,ct as B,U as C,Y as D,bt as E,I as F,yt as G,ke as H,ht as I,xt as J,St as K,A as L,_t as M};
|
|
84
|
-
//# sourceMappingURL=chunk-NLJCXHFU.js.map
|
package/dist/chunk-NRAJIFQA.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{k as m,l as r}from"./chunk-EHEZLULQ.js";import{a as n}from"./chunk-BT36WY5B.js";import{s as i}from"./chunk-NLJCXHFU.js";function h(l,s,a={}){let e=n(l,s);if(!e)return null;let t=a.semantic!==!1,c=r(l,e,{limit:50,semantic:t}),y=f(m(l,e,{limit:50,additive:!0,callableOnly:!0,semantic:t}));return{symbol:e.symbol,shortName:i(e.symbol),callers:c.map(o=>({symbol:o.symbol,shortName:i(o.symbol),file:o.file})),callees:y.map(o=>({symbol:o.symbol,shortName:i(o.symbol),file:o.file}))}}function f(l){let s=new Set,a=[];for(let e of l){let t=`${e.symbol}|${e.file}`;s.has(t)||(s.add(t),a.push(e))}return a}export{h as a};
|
|
2
|
-
//# sourceMappingURL=chunk-NRAJIFQA.js.map
|