scip-query 0.11.0 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +23 -0
- package/dist/{chunk-3KDUITBE.js → chunk-2LQWMYG4.js} +2 -2
- package/dist/{chunk-KKMOB3OJ.js → chunk-2QGE5AEP.js} +2 -2
- package/dist/{chunk-HINMXZ6J.js → chunk-4D54JIU3.js} +2 -2
- package/dist/{chunk-CMHYBXJB.js → chunk-52Q4JFDW.js} +2 -2
- package/dist/{chunk-UIKLA3F5.js → chunk-64PRNLKP.js} +2 -2
- package/dist/{chunk-QJ3FK4TB.js → chunk-72MFTCU5.js} +2 -2
- package/dist/{chunk-7HB3CZFD.js → chunk-7ITCOJGD.js} +2 -2
- package/dist/{chunk-ZEKBR4OK.js → chunk-AZLKLZ5S.js} +2 -2
- package/dist/{chunk-ODVITBYU.js → chunk-B4VYXRCQ.js} +2 -2
- package/dist/{chunk-STBXCPKY.js → chunk-BCNT6ODA.js} +2 -2
- package/dist/{chunk-WPSS37EW.js → chunk-BP2NAIAZ.js} +2 -2
- package/dist/{chunk-LWOOTRHC.js → chunk-BVNO67DB.js} +2 -2
- package/dist/{chunk-NBXK32I6.js → chunk-CW3KZ7UF.js} +2 -2
- package/dist/{chunk-UMPNL7T6.js → chunk-D64L53WX.js} +2 -2
- package/dist/{chunk-IFSX6YVU.js → chunk-D7J6GZAG.js} +2 -2
- package/dist/{chunk-WQHWIVA7.js → chunk-ECVXWZ4Q.js} +2 -2
- package/dist/{chunk-H4LUPLEJ.js → chunk-EDB7Y442.js} +2 -2
- package/dist/{chunk-QXGTGE2C.js → chunk-ETU2I5JM.js} +2 -2
- package/dist/{chunk-VXTNADIW.js → chunk-EXKLAEB4.js} +2 -2
- package/dist/{chunk-MNEJYEHW.js → chunk-EZ5WDZ2Q.js} +2 -2
- package/dist/{chunk-DRPAQAFM.js → chunk-F5BJSNU5.js} +2 -2
- package/dist/{chunk-343O6EVV.js → chunk-FBCOFKEC.js} +2 -2
- package/dist/{chunk-H56MGERE.js → chunk-G2UBOONK.js} +2 -2
- package/dist/{chunk-GCN2P4EJ.js → chunk-H2NMIZFD.js} +2 -2
- package/dist/{chunk-GHXRVCIY.js → chunk-HSU3M25J.js} +2 -2
- package/dist/{chunk-PYZZBIEU.js → chunk-IRJDYTNZ.js} +2 -2
- package/dist/{chunk-PZS6J5YG.js → chunk-KSUZS77X.js} +2 -2
- package/dist/{chunk-HZKMEXA3.js → chunk-L2CX5GHZ.js} +2 -2
- package/dist/{chunk-X6OGDTQH.js → chunk-LFM3O5KX.js} +2 -2
- package/dist/{chunk-TTS75UF2.js → chunk-M72ZFN6E.js} +2 -2
- package/dist/chunk-MBKJ7GHT.js +102 -0
- package/dist/{chunk-3T2FNHIU.js → chunk-MJKJMWIM.js} +2 -2
- package/dist/{chunk-WFGOH2UI.js → chunk-MKM7NBZK.js} +2 -2
- package/dist/{chunk-3V6JQQM5.js → chunk-NKT5EMEX.js} +2 -2
- package/dist/{chunk-BN5SXXQS.js → chunk-NQ75OVUU.js} +2 -2
- package/dist/{chunk-BDRBPG7Y.js → chunk-O3WDE26W.js} +2 -2
- package/dist/{chunk-N2Z3CU7X.js → chunk-OPE5YXFE.js} +2 -2
- package/dist/{chunk-XHWLNQVZ.js → chunk-OSWF3HSF.js} +2 -2
- package/dist/{chunk-Y6L4LXPG.js → chunk-OVMUVXKQ.js} +2 -2
- package/dist/{chunk-P36UR5II.js → chunk-PH7ZFK6L.js} +2 -2
- package/dist/chunk-PXHPCWX5.js +2 -0
- package/dist/{chunk-K2HYR5A7.js → chunk-Q3B3FNCU.js} +2 -2
- package/dist/{chunk-7XL7J7PT.js → chunk-Q7S2DADC.js} +2 -2
- package/dist/{chunk-FLJJLSGB.js → chunk-RA5MTIOO.js} +2 -2
- package/dist/{chunk-WZLPXFZU.js → chunk-RIQED5OU.js} +2 -2
- package/dist/{chunk-VGMUFW3J.js → chunk-T6NGEV5I.js} +2 -2
- package/dist/{chunk-XMR747CP.js → chunk-T7VQG55Q.js} +2 -2
- package/dist/{chunk-LZNLRE4X.js → chunk-TTMKELT7.js} +2 -2
- package/dist/{chunk-X4O6K47U.js → chunk-UAHZ57BR.js} +2 -2
- package/dist/{chunk-RJMXSHKM.js → chunk-V3Z3IOWO.js} +2 -2
- package/dist/{chunk-M2YXL62V.js → chunk-V7CVBPWX.js} +2 -2
- package/dist/{chunk-C4ICAIJ4.js → chunk-YDDGCJJG.js} +2 -2
- package/dist/{chunk-N7PNFLGY.js → chunk-YPKBZ77R.js} +2 -2
- package/dist/{chunk-WGA5BBTA.js → chunk-Z3IPJKJP.js} +2 -2
- package/dist/{chunk-ALHNAPS2.js → chunk-ZOIPAYRP.js} +2 -2
- package/dist/{chunk-6Q6OFLFQ.js → chunk-ZRIOGL7F.js} +2 -2
- package/dist/cli.js +243 -243
- package/dist/index.js +1 -1
- package/dist/queries/affected.js +1 -1
- package/dist/queries/bottlenecks.js +1 -1
- package/dist/queries/by-kind.js +1 -1
- package/dist/queries/call-graph.js +1 -1
- package/dist/queries/change-surface.js +1 -1
- package/dist/queries/cleanup-plan.js +1 -1
- package/dist/queries/code.js +1 -1
- package/dist/queries/complexity-hotspots.js +1 -1
- package/dist/queries/complexity.js +1 -1
- package/dist/queries/convergence.js +1 -1
- package/dist/queries/coupling.js +1 -1
- package/dist/queries/dataflow.js +1 -1
- package/dist/queries/dead.js +1 -1
- package/dist/queries/deps.js +1 -1
- package/dist/queries/diff-gate.js +1 -1
- package/dist/queries/diff-impact.js +1 -1
- package/dist/queries/drift.js +1 -1
- package/dist/queries/duplicate-bodies.js +1 -1
- package/dist/queries/extract-candidates.js +1 -1
- package/dist/queries/fan.js +1 -1
- package/dist/queries/health.js +1 -1
- package/dist/queries/hierarchy.js +1 -1
- package/dist/queries/hotspots.js +1 -1
- package/dist/queries/imports.js +1 -1
- package/dist/queries/incomplete-migration.js +1 -1
- package/dist/queries/index.js +1 -1
- package/dist/queries/isolated.js +1 -1
- package/dist/queries/locality-candidates.js +1 -1
- package/dist/queries/members.js +1 -1
- package/dist/queries/methods.js +1 -1
- package/dist/queries/outline.js +1 -1
- package/dist/queries/passthrough-candidates.js +1 -1
- package/dist/queries/plan-context.js +1 -1
- package/dist/queries/recent-duplicates.js +1 -1
- package/dist/queries/redundant-reexports.js +1 -1
- package/dist/queries/refs.js +1 -1
- package/dist/queries/self-audit.js +1 -1
- package/dist/queries/similar-signatures.js +1 -1
- package/dist/queries/similar.js +1 -1
- package/dist/queries/slice.js +1 -1
- package/dist/queries/stale-abstractions.js +1 -1
- package/dist/queries/surface.js +1 -1
- package/dist/queries/symbols.js +1 -1
- package/dist/queries/system.js +1 -1
- package/dist/queries/trace.js +1 -1
- package/dist/queries/twin-ab.js +1 -1
- package/dist/queries/twin-drift.js +1 -1
- package/dist/queries/unused-imports.js +1 -1
- package/dist/queries/unused-params.js +1 -1
- package/dist/queries/wrapper-candidates.js +1 -1
- package/dist/reindex-worker.js +9 -9
- package/dist/reindex.d.ts +20 -1
- package/dist/reindex.js +19 -19
- package/docs/COMMAND_REFERENCE.md +2 -2
- package/package.json +20 -2
- package/skills/scip-tla-model-system/SKILL.md +17 -5
- package/dist/chunk-2VSDXOG5.js +0 -2
- package/dist/chunk-R3JY4EZ4.js +0 -102
package/dist/chunk-R3JY4EZ4.js
DELETED
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
import{a as f,b as F,c as m,d as N,e as E,f as p,h as M}from"./chunk-HXXMPYEF.js";import{h as R}from"./chunk-T2FQ4GHD.js";import{b,c as D,i as _,m as L,o as h}from"./chunk-WS3Z6W3M.js";import{a as S}from"./chunk-64MNV6AB.js";import{c as g}from"./chunk-7S5E7KWT.js";function be(e,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 ${n.where}
|
|
6
|
-
${e.pathExclusionsFor("d")}
|
|
7
|
-
${k(n.orderBy)}
|
|
8
|
-
${w(n.limit)}`,...n.params??[])}function De(e,n){return e.all(`SELECT
|
|
9
|
-
gs.id,
|
|
10
|
-
gs.symbol,
|
|
11
|
-
c.document_id,
|
|
12
|
-
MIN(c.start_line) AS start_line,
|
|
13
|
-
MAX(c.end_line) AS end_line,
|
|
14
|
-
d.relative_path,
|
|
15
|
-
gs.display_name,
|
|
16
|
-
gs.documentation
|
|
17
|
-
FROM global_symbols gs
|
|
18
|
-
JOIN mentions m ON m.symbol_id = gs.id
|
|
19
|
-
JOIN chunks c ON m.chunk_id = c.id
|
|
20
|
-
JOIN documents d ON c.document_id = d.id
|
|
21
|
-
WHERE m.role = 1
|
|
22
|
-
AND ${n.where}
|
|
23
|
-
${e.pathExclusionsFor("d")}
|
|
24
|
-
GROUP BY gs.id, gs.symbol, c.document_id, d.relative_path, gs.display_name, gs.documentation
|
|
25
|
-
${k(n.orderBy)}
|
|
26
|
-
${w(n.limit)}`,...n.params??[])}function k(e){return e?`ORDER BY ${e}`:""}function w(e){return typeof e=="number"?`LIMIT ${e}`:""}function $(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 C(e){if(!e)return null;let n=O(e);if(n)return n.replace(/\n/g," ");let t=e.indexOf("|");if(t===-1)return e.replace(/\n/g," ");let i=e.slice(t+1);return(O(i)??i).replace(/\n/g," ")}function O(e){return/^```(?:\w+)?\s*\n?([\s\S]*?)\n?```/.exec(e.trimStart())?.[1]?.trim()||null}function H(e){if(m(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 x(e,n,t={}){let i=new Map;for(let o of n)e.length>0&&!H(o)||i.set(o.id,o);for(let o of e)i.set(o.id,o);let r=[...i.values()];return t.sort?r.sort((o,s)=>o.start_line-s.start_line||o.end_line-s.end_line||o.symbol.localeCompare(s.symbol)):r}var W=g("file-definitions",{clearGroups:["definition-catalog"]}),Y=g("file-function-like-definitions",{clearGroups:["definition-catalog"]}),T=new WeakMap;function I(e,n){return W.get(e,n,()=>{let t=v(e,n);if(t)return t;let i=B(e,n),r=D(e),o=f(e).forFile(n,{text:!0}).text;return r&&o&&P.write(e,n,b(e,n,o),{projectFingerprint:r,definitions:i.map(s=>({...s}))}),i})}function K(e,n){return Y.get(e,n,()=>{let t=v(e,n);return t?t.filter(i=>i.isFunctionLike):B(e,n,i=>i.isFunctionLike)})}var P=L({kind:"file-definitions",invalidation:h("file-definitions"),serialize:G,deserialize:U});function v(e,n){let t=D(e);if(!t)return null;let i=f(e).forFile(n,{text:!0}).text;if(!i)return null;let r=P.read(e,n,b(e,n,i));return r?q(r,t,n):null}function G(e){return JSON.stringify(e)}function U(e){try{let n=JSON.parse(e);return!_(n)||typeof n.projectFingerprint!="string"||!Array.isArray(n.definitions)?null:{projectFingerprint:n.projectFingerprint,definitions:n.definitions}}catch{return null}}function q(e,n,t){if(e.projectFingerprint!==n)return null;let i=[];for(let r of e.definitions){let o=X(r,t);if(!o)return null;i.push(o)}return i}function X(e,n){return!_(e)||typeof e.symbolId!="number"||typeof e.symbol!="string"||typeof e.documentId!="number"||typeof e.startLine!="number"||typeof e.endLine!="number"||e.relativePath!==n||typeof e.leaf!="string"||typeof e.parentTypeName!="string"&&e.parentTypeName!==null||typeof e.isFunctionLike!="boolean"||typeof e.isTypeLike!="boolean"||typeof e.kind!="number"&&e.kind!==null||typeof e.documentation!="string"&&e.documentation!==null||typeof e.enclosingSymbol!="string"&&e.enclosingSymbol!==null?null:{symbolId:e.symbolId,symbol:e.symbol,documentId:e.documentId,startLine:e.startLine,endLine:e.endLine,relativePath:e.relativePath,leaf:e.leaf,parentTypeName:e.parentTypeName,isFunctionLike:e.isFunctionLike,isTypeLike:e.isTypeLike,kind:e.kind,documentation:e.documentation,enclosingSymbol:e.enclosingSymbol}}function B(e,n,t){let i=x(Z(e,n),V(e,n),{sort:!0}).map(J);return t&&(i=i.filter(t)),j(e,n,i)}function Z(e,n){return e.all(`SELECT
|
|
27
|
-
gs.id,
|
|
28
|
-
gs.symbol,
|
|
29
|
-
der.document_id,
|
|
30
|
-
der.start_line,
|
|
31
|
-
der.end_line,
|
|
32
|
-
d.relative_path,
|
|
33
|
-
gs.display_name,
|
|
34
|
-
gs.kind,
|
|
35
|
-
gs.documentation,
|
|
36
|
-
gs.enclosing_symbol
|
|
37
|
-
FROM global_symbols gs
|
|
38
|
-
JOIN defn_enclosing_ranges der ON gs.id = der.symbol_id
|
|
39
|
-
JOIN documents d ON der.document_id = d.id
|
|
40
|
-
WHERE d.relative_path = ?
|
|
41
|
-
${e.symbolNoiseFor("gs")}
|
|
42
|
-
ORDER BY der.start_line, der.end_line`,n)}function V(e,n){return e.all(`SELECT
|
|
43
|
-
gs.id,
|
|
44
|
-
gs.symbol,
|
|
45
|
-
c.document_id,
|
|
46
|
-
MIN(c.start_line) AS start_line,
|
|
47
|
-
MAX(c.end_line) AS end_line,
|
|
48
|
-
d.relative_path,
|
|
49
|
-
gs.display_name,
|
|
50
|
-
gs.kind,
|
|
51
|
-
gs.documentation,
|
|
52
|
-
gs.enclosing_symbol
|
|
53
|
-
FROM global_symbols gs
|
|
54
|
-
JOIN mentions m ON m.symbol_id = gs.id
|
|
55
|
-
JOIN chunks c ON m.chunk_id = c.id
|
|
56
|
-
JOIN documents d ON c.document_id = d.id
|
|
57
|
-
WHERE d.relative_path = ?
|
|
58
|
-
AND m.role = 1
|
|
59
|
-
${e.symbolNoiseFor("gs")}
|
|
60
|
-
GROUP BY gs.id, gs.symbol, c.document_id, d.relative_path
|
|
61
|
-
ORDER BY start_line, end_line`,n)}function J(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:E(e.symbol),parentTypeName:m(e.symbol),isFunctionLike:M(e.symbol),isTypeLike:p(e.symbol)==="type",kind:e.kind??null,documentation:e.documentation??null,enclosingSymbol:e.enclosing_symbol??null}}function we(e,n={}){return ee(e,n.scope)}function ee(e,n){return S(e,{scope:n,includeIgnored:!1}).flatMap(t=>I(e,t)).filter(t=>!e.isIgnored(t.relativePath))}function $e(e,n){return S(e,{scope:n,includeIgnored:!1}).flatMap(t=>K(e,t)).filter(t=>!e.isIgnored(t.relativePath))}function Ce(e,n){let t=A(ne(e,n.scope,n.sqlPrefilter)),i=A(te(e,n.scope,n.sqlPrefilter)),r=new Set([...t.keys(),...i.keys()]),o=[];for(let s of[...r].sort()){if(e.isIgnored(s))continue;let l=x(t.get(s)??[],i.get(s)??[],{sort:!0}).filter(a=>n.symbolMatches(a.symbol));l.length!==0&&o.push(...j(e,s,l.map(J)))}return o}function ne(e,n,t){let i=n?"AND d.relative_path LIKE ?":"",r=t?`AND ${z("gs",t)}`:"",o=n?[`%${n}%`]:[];return e.all(`SELECT
|
|
62
|
-
gs.id,
|
|
63
|
-
gs.symbol,
|
|
64
|
-
der.document_id,
|
|
65
|
-
der.start_line,
|
|
66
|
-
der.end_line,
|
|
67
|
-
d.relative_path,
|
|
68
|
-
gs.display_name,
|
|
69
|
-
gs.kind,
|
|
70
|
-
gs.documentation,
|
|
71
|
-
gs.enclosing_symbol
|
|
72
|
-
FROM global_symbols gs
|
|
73
|
-
JOIN defn_enclosing_ranges der ON gs.id = der.symbol_id
|
|
74
|
-
JOIN documents d ON der.document_id = d.id
|
|
75
|
-
WHERE 1 = 1
|
|
76
|
-
${e.pathExclusionsFor("d")}
|
|
77
|
-
${i}
|
|
78
|
-
${r}
|
|
79
|
-
${e.symbolNoiseFor("gs")}
|
|
80
|
-
ORDER BY d.relative_path, der.start_line, der.end_line`,...o)}function te(e,n,t){let i=n?"AND d.relative_path LIKE ?":"",r=t?`AND ${z("gs",t)}`:"",o=n?[`%${n}%`]:[];return e.all(`SELECT
|
|
81
|
-
gs.id,
|
|
82
|
-
gs.symbol,
|
|
83
|
-
c.document_id,
|
|
84
|
-
MIN(c.start_line) AS start_line,
|
|
85
|
-
MAX(c.end_line) AS end_line,
|
|
86
|
-
d.relative_path,
|
|
87
|
-
gs.display_name,
|
|
88
|
-
gs.kind,
|
|
89
|
-
gs.documentation,
|
|
90
|
-
gs.enclosing_symbol
|
|
91
|
-
FROM global_symbols gs
|
|
92
|
-
JOIN mentions m ON m.symbol_id = gs.id
|
|
93
|
-
JOIN chunks c ON m.chunk_id = c.id
|
|
94
|
-
JOIN documents d ON c.document_id = d.id
|
|
95
|
-
WHERE m.role = 1
|
|
96
|
-
${e.pathExclusionsFor("d")}
|
|
97
|
-
${i}
|
|
98
|
-
${r}
|
|
99
|
-
${e.symbolNoiseFor("gs")}
|
|
100
|
-
GROUP BY gs.id, gs.symbol, c.document_id, d.relative_path
|
|
101
|
-
ORDER BY d.relative_path, start_line, end_line`,...o)}function ie(e){return`(${e}.symbol LIKE '%().' OR ${e}.symbol LIKE '%()')`}function z(e,n){return n==="callable"?ie(e):re(e)}function re(e){return`(${e}.symbol LIKE '%.' OR ${e}.symbol LIKE '%()')`}function A(e){let n=new Map;for(let t of e){let i=n.get(t.relative_path);i?i.push(t):n.set(t.relative_path,[t])}return n}function Te(e,n,t={}){if(n.length===0)return[];let i=n.flatMap(r=>I(e,r)).filter(r=>!e.isIgnored(r.relativePath));return t.onlyDocumented&&(i=i.filter(r=>r.documentation!==null&&r.documentation!=="")),t.sort&&(i=i.sort((r,o)=>r.relativePath.localeCompare(o.relativePath)||r.startLine-o.startLine||r.endLine-o.endLine)),i.map(r=>({startLine:r.startLine,endLine:r.endLine,symbol:r.symbol,shortName:N(r.symbol),signature:$(C(r.documentation)),relativePath:r.relativePath,enclosingSymbol:r.enclosingSymbol}))}function oe(e){let n=new Map,t=e.map((i,r)=>({definition:i,index:r,span:i.endLine-i.startLine})).sort((i,r)=>i.span-r.span||i.index-r.index);for(let{definition:i}of t)for(let r=i.startLine;r<=i.endLine;r+=1)n.has(r)||n.set(r,i);return n}function Ae(e,n){let t=T.get(e);return t||(t=oe(e),T.set(e,t)),t.get(n)??null}function Qe(e,n){let t=I(e,n.relative_path).find(i=>i.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 j(e,n,t){let i=f(e).forFile(n,{text:!0}).text,r=R(e,n);return r?me(t,r,i):i?se(t,i):t}function se(e,n){let t=n.split(/\r?\n/),i=le(e,t),r=ae(e,i),o=ce(r,t);return de(e,o)}function le(e,n){let t=e.some(r=>y(r.symbol))?pe(n):null,i=new Map;for(let r of e)i.set(r.symbolId,fe(n,t,r));return i}function ae(e,n){return e.filter(t=>y(t.symbol)).map(t=>({definition:t,startLine:n.get(t.symbolId)??t.startLine})).sort((t,i)=>t.startLine-i.startLine||t.definition.startLine-i.definition.startLine||t.definition.symbol.localeCompare(i.definition.symbol))}function ce(e,n){let t=new Map;for(let i=0;i<e.length;i+=1){let r=e[i],o=e[i+1],s=o?Math.max(r.startLine,o.startLine-1):n.length-1;t.set(r.definition.symbolId,{startLine:r.startLine,endLine:ye(n,r.definition,r.startLine,s)})}return t}function de(e,n){return e.map(t=>{let i=n.get(t.symbolId);return i?{...t,startLine:i.startLine,endLine:i.endLine}:t})}function me(e,n,t=null){let i=new Map;for(let r of n){let o=i.get(r.name);o?o.push(r):i.set(r.name,[r])}return e.map(r=>{if(!ue(r)||!r.leaf)return Q(r,t);let o=i.get(r.leaf);if(!o||o.length===0)return Q(r,t);let s=o[0],l=Math.abs(s.startLine-r.startLine);for(let a=1;a<o.length;a+=1){let c=o[a],d=Math.abs(c.startLine-r.startLine);d<l&&(s=c,l=d)}return{...r,startLine:s.startLine,endLine:s.endLine}})}function ue(e){return y(e.symbol)?!0:p(e.symbol)==="term"&&m(e.symbol)===null}function Q(e,n){if(!n||!e.leaf||p(e.symbol)!=="term"||m(e.symbol)!==null)return e;let t=e.leaf.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),i=new RegExp(`\\b(?:export\\s+)?(?:const|let|var)\\s+${t}\\b`),o=n.split(/\r?\n/).findIndex(s=>i.test(s));return o>=0?{...e,startLine:o,endLine:o}:e}function fe(e,n,t){if(!y(t.symbol))return t.startLine;let i=Math.max(0,Math.min(t.startLine,e.length-1));if(!n)return i;let r=n.get(t.leaf);if(!r||r.length===0)return i;let o=null;for(let s of r){let l=Math.abs(s-t.startLine);(!o||l<o.distance)&&(o={line:s,distance:l})}return o?.line??i}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,i=/^\s*(?:(?:export|public|private|protected|static|readonly|async|abstract|get|set)\s+)*([A-Za-z_$][\w$]*)\s*(?:<[^(]*>)?\s*\(/,r=/\b([A-Za-z_$][\w$]*)\s*\(/g,o=new Map,s=(l,a)=>{let c=o.get(l);if(!c){o.set(l,[a]);return}c[c.length-1]!==a&&c.push(a)};for(let l=0;l<e.length;l+=1){let a=e[l]??"";for(let d of a.matchAll(n))d[1]&&s(d[1],l);for(let d of a.matchAll(t))d[1]&&s(d[1],l);let c=a.match(i);c?.[1]&&s(c[1],l);for(let d of a.matchAll(r))d[1]&&s(d[1],l)}return o}function ye(e,n,t,i){let r=Math.max(t,Math.min(e.length-1,i)),o=Math.max(t,Math.min(r,n.endLine)),s=0,l=0,a=!1;for(let c=t;c<=r;c+=1){let d=ge(e[c]??"");for(let u of d)u==="{"?(s+=1,a=!0):u==="}"?s=Math.max(0,s-1):u==="("?l+=1:u===")"&&(l=Math.max(0,l-1));if(a&&s===0||!a&&l===0&&c>=o)return c}return o}function ge(e){let n="",t=null,i=!1;for(let r=0;r<e.length;r+=1){let o=e[r],s=e[r+1];if(!t&&o==="/"&&s==="/"){n+=" ".repeat(e.length-r);break}if(t){if(i){i=!1,n+=" ";continue}if(o==="\\"){i=!0,n+=" ";continue}o===t&&(t=null),n+=" ";continue}if(o==='"'||o==="'"||o==="`"){t=o,n+=" ";continue}n+=o}return n}function y(e){return e.includes("().")}function Pe(e){let n=F(e);if("kind"in n)return[];let t=[];for(let i=n.descriptors.length-2;i>=0;i-=1){let r=n.descriptors[i];r?.suffix==="type"&&r.name&&t.push(r.name)}return t}export{be as a,De as b,$ as c,C as d,x as e,I as f,we as g,ee as h,$e as i,Ce as j,Te as k,oe as l,Ae as m,Qe as n,Pe as o};
|
|
102
|
-
//# sourceMappingURL=chunk-R3JY4EZ4.js.map
|