scip-query 0.10.0 → 0.10.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 +115 -58
- package/dist/augment-vue-worker.js +1 -1
- package/dist/chunk-23FVN4Y5.js +2 -0
- package/dist/chunk-24PFLKFK.js +2 -0
- package/dist/{chunk-A2VTV2QB.js → chunk-27KPKLRJ.js} +2 -2
- package/dist/chunk-2NLK4INB.js +2 -0
- package/dist/{chunk-6K2JQ2VI.js → chunk-2XKAMW6B.js} +2 -2
- package/dist/{chunk-4DAPXOWD.js → chunk-332L7SRO.js} +2 -2
- package/dist/chunk-44JOJLMO.js +38 -0
- package/dist/{chunk-MCW36F2D.js → chunk-4EAANIWC.js} +2 -2
- package/dist/{chunk-FVIKFWUL.js → chunk-4N7LFYSD.js} +2 -2
- package/dist/{chunk-4MHT7LKP.js → chunk-5ALI77D7.js} +2 -2
- package/dist/{chunk-V76FCF5F.js → chunk-5BZOSICN.js} +2 -2
- package/dist/{chunk-IVAIPXNO.js → chunk-5D3BT4B4.js} +2 -2
- package/dist/{chunk-ADRYSISR.js → chunk-5HDYAOSF.js} +2 -2
- package/dist/{chunk-IC3RC3KJ.js → chunk-5IDEQEM4.js} +2 -2
- package/dist/{chunk-NC4IUW25.js → chunk-5VB3WU7K.js} +2 -2
- package/dist/chunk-623UQCVG.js +2 -0
- package/dist/chunk-62NMBOA5.js +2 -0
- package/dist/chunk-64LH2QUP.js +62 -0
- package/dist/{chunk-PG3ZI5IH.js → chunk-65UWNXEH.js} +1 -1
- package/dist/{chunk-OLCKSG3Y.js → chunk-6TWFT4Y5.js} +2 -2
- package/dist/chunk-6U4EODW3.js +2 -0
- package/dist/{chunk-MN75T4UB.js → chunk-6YKJSETN.js} +2 -2
- package/dist/chunk-A2GVUCZR.js +8 -0
- package/dist/{chunk-WEJYUS5O.js → chunk-ADKQX2OY.js} +2 -2
- package/dist/{chunk-YWZBKYLS.js → chunk-ADTG377O.js} +2 -2
- package/dist/chunk-ATGRITZP.js +20 -0
- package/dist/chunk-B3HMRQDA.js +2 -0
- package/dist/chunk-B75HZHUP.js +2 -0
- package/dist/chunk-BGBBVSH4.js +2 -0
- package/dist/chunk-BJ7OHKB5.js +2 -0
- package/dist/{chunk-VZRILF2Z.js → chunk-CCB45WDY.js} +2 -2
- package/dist/chunk-CFLYMEUS.js +2 -0
- package/dist/{chunk-ISCKLDSS.js → chunk-CMGOXDVP.js} +3 -3
- package/dist/chunk-DBIG4QAJ.js +2 -0
- package/dist/{chunk-4JQFTUKD.js → chunk-DMLPJ75B.js} +2 -2
- package/dist/chunk-DRU74YUM.js +71 -0
- package/dist/chunk-DTERBKUE.js +7 -0
- package/dist/{chunk-4HTJZC6G.js → chunk-E55WCTLH.js} +2 -2
- package/dist/{chunk-CMXFASVD.js → chunk-F4PKYBQB.js} +2 -2
- package/dist/{chunk-L2KFPRMA.js → chunk-FVX4GEAC.js} +2 -2
- package/dist/{chunk-AP5GTKSG.js → chunk-GTNPPGZJ.js} +2 -2
- package/dist/{chunk-ZZ2W5P3D.js → chunk-GZXXBDJA.js} +2 -2
- package/dist/chunk-HCQ7J2N5.js +3 -0
- package/dist/chunk-HQHFMPLJ.js +2 -0
- package/dist/{chunk-SCEMECW7.js → chunk-I6PTB2CM.js} +2 -2
- package/dist/{chunk-772YYL6I.js → chunk-IJYWCB57.js} +2 -2
- package/dist/chunk-JTRY2YRJ.js +2 -0
- package/dist/chunk-L77GXANO.js +6 -0
- package/dist/{chunk-R6XDPWJA.js → chunk-LT6GJ27X.js} +2 -2
- package/dist/chunk-LUBKUISI.js +2 -0
- package/dist/{chunk-ZGIK464P.js → chunk-LVYXX7ZW.js} +2 -2
- package/dist/{chunk-2WEH5QHC.js → chunk-LWPEZ4FP.js} +2 -2
- package/dist/chunk-LWWZBABT.js +2 -0
- package/dist/chunk-LXM7AHQG.js +4 -0
- package/dist/chunk-LY6NRJPJ.js +2 -0
- package/dist/chunk-LYS4SMAQ.js +2 -0
- package/dist/{chunk-BNW3Q24R.js → chunk-MESUJJVQ.js} +2 -2
- package/dist/{chunk-Y5H7TBVE.js → chunk-MHAQXOZY.js} +2 -2
- package/dist/chunk-N2T2GPYQ.js +2 -0
- package/dist/chunk-OB6PEVI3.js +2 -0
- package/dist/chunk-PNN3D4BE.js +2 -0
- package/dist/{chunk-QJWN6LA5.js → chunk-PV4CEDIL.js} +2 -2
- package/dist/chunk-QH5GTVVB.js +3 -0
- package/dist/{chunk-ZOT3WUZW.js → chunk-QOFKVNFE.js} +2 -2
- package/dist/chunk-QUKZ77A6.js +4 -0
- package/dist/chunk-R42LZMLX.js +2 -0
- package/dist/{chunk-2BMFRBV6.js → chunk-R7S3UCDR.js} +2 -2
- package/dist/chunk-RGDUIMNE.js +3 -0
- package/dist/{chunk-BGRPMGTD.js → chunk-RNLUCQJB.js} +2 -2
- package/dist/chunk-RYBMW2EN.js +2 -0
- package/dist/{chunk-VGBSY6N7.js → chunk-SA6B3EGD.js} +2 -2
- package/dist/chunk-T67R7V5I.js +2 -0
- package/dist/chunk-TMS4JPWY.js +3 -0
- package/dist/chunk-TTGWDUJ4.js +5 -0
- package/dist/chunk-TUAPDKBI.js +2 -0
- package/dist/chunk-UVK3SL4Z.js +2 -0
- package/dist/chunk-W3PQRAI4.js +2 -0
- package/dist/{chunk-PRVDXGSK.js → chunk-WWFBDM5Y.js} +2 -2
- package/dist/{chunk-AQYBOORI.js → chunk-WZVTADY7.js} +1 -1
- package/dist/chunk-XGGTESMN.js +2 -0
- package/dist/{chunk-NGI4V4AB.js → chunk-Y33GRQK6.js} +2 -2
- package/dist/{chunk-QKO474FG.js → chunk-YIE5FZAF.js} +2 -2
- package/dist/chunk-YISMWW66.js +7 -0
- package/dist/chunk-YVQUQIBM.js +5 -0
- package/dist/{chunk-6DEX3XP6.js → chunk-YYCQQBMG.js} +2 -2
- package/dist/cli.js +221 -233
- package/dist/{config-types-CGIeLEpY.d.ts → config-types-Bok4jrO3.d.ts} +29 -1
- package/dist/{db-DdTPetj5.d.ts → db-BkFlkzI3.d.ts} +1 -1
- package/dist/{health-C6r2VgpA.d.ts → health-CbGMdRPg.d.ts} +42 -3
- package/dist/index.d.ts +7 -6
- package/dist/index.js +1 -1
- package/dist/postinstall.js +2 -2
- package/dist/queries/affected.d.ts +2 -2
- package/dist/queries/affected.js +1 -1
- package/dist/queries/bottlenecks.d.ts +2 -2
- package/dist/queries/bottlenecks.js +1 -1
- package/dist/queries/by-kind.d.ts +2 -2
- package/dist/queries/by-kind.js +1 -1
- package/dist/queries/call-graph.d.ts +2 -2
- package/dist/queries/call-graph.js +1 -1
- package/dist/queries/change-surface.d.ts +2 -2
- package/dist/queries/change-surface.js +1 -1
- package/dist/queries/cleanup-plan.d.ts +2 -2
- package/dist/queries/cleanup-plan.js +1 -1
- package/dist/queries/co-change.d.ts +5 -4
- package/dist/queries/co-change.js +1 -1
- package/dist/queries/code.d.ts +2 -2
- package/dist/queries/code.js +1 -1
- package/dist/queries/complexity-hotspots.d.ts +2 -2
- package/dist/queries/complexity-hotspots.js +1 -1
- package/dist/queries/complexity.d.ts +2 -2
- package/dist/queries/complexity.js +1 -1
- package/dist/queries/convergence.d.ts +2 -2
- package/dist/queries/convergence.js +1 -1
- package/dist/queries/coupling.d.ts +2 -2
- package/dist/queries/coupling.js +1 -1
- package/dist/queries/cycles.d.ts +2 -2
- package/dist/queries/cycles.js +1 -1
- package/dist/queries/dataflow.d.ts +2 -2
- package/dist/queries/dataflow.js +1 -1
- package/dist/queries/dead.d.ts +2 -2
- package/dist/queries/dead.js +1 -1
- package/dist/queries/deep-chains.d.ts +2 -2
- package/dist/queries/deep-chains.js +1 -1
- package/dist/queries/deps.d.ts +2 -2
- package/dist/queries/deps.js +1 -1
- package/dist/queries/diff-gate.d.ts +21 -3
- package/dist/queries/diff-gate.js +1 -1
- package/dist/queries/diff-impact.d.ts +20 -4
- package/dist/queries/diff-impact.js +1 -1
- package/dist/queries/doc-drift.d.ts +2 -2
- package/dist/queries/doc-drift.js +1 -1
- package/dist/queries/drift.d.ts +2 -2
- package/dist/queries/drift.js +1 -1
- package/dist/queries/extract-candidates.d.ts +2 -2
- package/dist/queries/extract-candidates.js +1 -1
- package/dist/queries/fan.d.ts +2 -2
- package/dist/queries/fan.js +1 -1
- package/dist/queries/files.d.ts +2 -2
- package/dist/queries/files.js +1 -1
- package/dist/queries/health.d.ts +3 -3
- package/dist/queries/health.js +1 -1
- package/dist/queries/hierarchy.d.ts +2 -2
- package/dist/queries/hierarchy.js +1 -1
- package/dist/queries/hotspots.d.ts +2 -2
- package/dist/queries/hotspots.js +1 -1
- package/dist/queries/imports.d.ts +2 -2
- package/dist/queries/imports.js +1 -1
- package/dist/queries/incomplete-migration.d.ts +4 -2
- package/dist/queries/incomplete-migration.js +1 -1
- package/dist/queries/index.d.ts +10 -4
- package/dist/queries/index.js +1 -1
- package/dist/queries/isolated.d.ts +2 -2
- package/dist/queries/isolated.js +1 -1
- package/dist/queries/members.d.ts +2 -2
- package/dist/queries/members.js +1 -1
- package/dist/queries/methods.d.ts +2 -2
- package/dist/queries/methods.js +1 -1
- package/dist/queries/outline.d.ts +2 -2
- package/dist/queries/outline.js +1 -1
- package/dist/queries/passthrough-candidates.d.ts +2 -2
- package/dist/queries/passthrough-candidates.js +1 -1
- package/dist/queries/plan-context.d.ts +2 -2
- package/dist/queries/plan-context.js +1 -1
- package/dist/queries/react-component-duplicates.d.ts +31 -0
- package/dist/queries/react-component-duplicates.js +2 -0
- package/dist/queries/react-hook-candidates.d.ts +34 -0
- package/dist/queries/react-hook-candidates.js +2 -0
- package/dist/queries/react-large-component-pressure.d.ts +28 -0
- package/dist/queries/react-large-component-pressure.js +2 -0
- package/dist/queries/recent-duplicates.d.ts +10 -3
- package/dist/queries/recent-duplicates.js +1 -1
- package/dist/queries/redundant-reexports.d.ts +2 -2
- package/dist/queries/redundant-reexports.js +1 -1
- package/dist/queries/refs.d.ts +2 -2
- package/dist/queries/refs.js +1 -1
- package/dist/queries/self-audit.d.ts +2 -2
- package/dist/queries/self-audit.js +1 -1
- package/dist/queries/similar-chains.d.ts +2 -2
- package/dist/queries/similar-chains.js +1 -1
- package/dist/queries/similar-files.d.ts +2 -2
- package/dist/queries/similar-files.js +1 -1
- package/dist/queries/similar-signatures.d.ts +2 -2
- package/dist/queries/similar-signatures.js +1 -1
- package/dist/queries/similar.d.ts +8 -3
- package/dist/queries/similar.js +1 -1
- package/dist/queries/slice.d.ts +2 -2
- package/dist/queries/slice.js +1 -1
- package/dist/queries/stale-abstractions.d.ts +2 -2
- package/dist/queries/stale-abstractions.js +1 -1
- package/dist/queries/stats.d.ts +2 -2
- package/dist/queries/stats.js +1 -1
- package/dist/queries/surface.d.ts +2 -2
- package/dist/queries/surface.js +1 -1
- package/dist/queries/symbols.d.ts +2 -2
- package/dist/queries/symbols.js +1 -1
- package/dist/queries/system.d.ts +2 -2
- package/dist/queries/system.js +1 -1
- package/dist/queries/trace.d.ts +2 -2
- package/dist/queries/trace.js +1 -1
- package/dist/queries/unused-params.d.ts +2 -2
- package/dist/queries/unused-params.js +1 -1
- package/dist/queries/vue-component-duplicates.d.ts +35 -0
- package/dist/queries/vue-component-duplicates.js +2 -0
- package/dist/queries/vue-composable-candidates.d.ts +34 -0
- package/dist/queries/vue-composable-candidates.js +2 -0
- package/dist/queries/vue-large-view-pressure.d.ts +31 -0
- package/dist/queries/vue-large-view-pressure.js +2 -0
- package/dist/queries/wrapper-candidates.d.ts +2 -2
- package/dist/queries/wrapper-candidates.js +1 -1
- package/dist/reindex-worker.js +10 -10
- package/dist/reindex.d.ts +1 -1
- package/dist/reindex.js +22 -22
- package/dist/runtime.d.ts +1 -1
- package/dist/runtime.js +2 -2
- package/docs/AGENT_GUIDE.md +353 -0
- package/docs/AI_FAILURE_MODES.md +278 -0
- package/docs/API.md +40 -0
- package/docs/COMMAND_REFERENCE.md +130 -0
- package/docs/DETECTOR_GUIDE.md +119 -0
- package/docs/accuracy-hardening-goal.md +54 -0
- package/docs/assets/scip-query-logo-dark.svg +21 -0
- package/docs/assets/scip-query-logo.svg +24 -0
- package/package.json +31 -3
- package/skills/scip-maintainability/SKILL.md +24 -3
- package/skills/scip-query/SKILL.md +2 -1
- package/skills/scip-react-maintainability/SKILL.md +114 -0
- package/skills/scip-vue-maintainability/SKILL.md +130 -0
- package/dist/chunk-5OHZEO3U.js +0 -3
- package/dist/chunk-5QJIEYFB.js +0 -34
- package/dist/chunk-6IGXZZQ4.js +0 -4
- package/dist/chunk-6QVCPUK6.js +0 -2
- package/dist/chunk-6VL4AIEO.js +0 -8
- package/dist/chunk-AI2ECT7L.js +0 -2
- package/dist/chunk-BUAC4Q4G.js +0 -2
- package/dist/chunk-BZ6LCGE6.js +0 -2
- package/dist/chunk-CO3AL7NZ.js +0 -2
- package/dist/chunk-FVVT7GV6.js +0 -4
- package/dist/chunk-HXXRN77A.js +0 -2
- package/dist/chunk-ITHQJZTG.js +0 -2
- package/dist/chunk-IW7ASGVF.js +0 -2
- package/dist/chunk-JODYQDE4.js +0 -2
- package/dist/chunk-MX6F756F.js +0 -2
- package/dist/chunk-O6KCZPJQ.js +0 -62
- package/dist/chunk-OAI5GEIN.js +0 -6
- package/dist/chunk-OH5HIAID.js +0 -4
- package/dist/chunk-OXKEUWMJ.js +0 -2
- package/dist/chunk-PBGTMPJ7.js +0 -2
- package/dist/chunk-QYKKTYBN.js +0 -6
- package/dist/chunk-R3G6ERW7.js +0 -7
- package/dist/chunk-SJR4SB7B.js +0 -2
- package/dist/chunk-SYKCO25G.js +0 -16
- package/dist/chunk-T22X7WT6.js +0 -2
- package/dist/chunk-TH4JVC34.js +0 -71
- package/dist/chunk-VDY4HYNK.js +0 -2
- package/dist/chunk-VDZIEDJB.js +0 -2
- package/dist/chunk-VDZL45XI.js +0 -2
- package/dist/chunk-WJIS6BNI.js +0 -3
- package/dist/chunk-WN5Z3UVT.js +0 -7
- package/dist/chunk-XCW7DYHM.js +0 -2
- package/dist/chunk-ZF6P2NAT.js +0 -63
package/dist/chunk-PBGTMPJ7.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as l}from"./chunk-NN3O7TPH.js";import{c as d}from"./chunk-VDZL45XI.js";import{readdirSync as x}from"fs";import{extname as p,join as f}from"path";var m=[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs",".vue",".rs",".py",".pyi",".java",".kt",".kts",".scala",".sc",".rb",".c",".h",".cc",".cpp",".cxx",".hpp",".hh",".hxx",".cs",".vb",".php",".dart"],j=[".vue"],S=new Set(m.map(t=>t.toLowerCase())),g=[...S].sort().join(","),y=new Set(["node_modules",".git","target","dist","build",".next",".nuxt",".cache",".turbo","out","coverage",".scipquery-cache","__pycache__",".venv","venv",".idea",".vscode"]);function w(t,o={}){let s=o.includeIndexed??!0,i=o.includeAuxiliary??!0,e=o.extensions?.map(c=>c.toLowerCase()),r=e?new Set(e):S,u=e?[...r].sort().join(","):g,n=`${s?"1":"0"}|${i?"1":"0"}|${u}`;return h.get(t,n,()=>{let c=new Set;if(s)for(let a of l(t,{includeIgnored:!1}))r.has(p(a).toLowerCase())&&c.add(a);if(i)for(let a of E(t.config.projectRoot,r))t.isIgnored(a)||c.add(a);return[...c].sort()})}var h=d("source-files",{clearGroups:[]});function E(t,o){let s=new Set,i=e=>{let r=e?f(t,e):t,u;try{u=x(r,{withFileTypes:!0})}catch{return}for(let n of u)if(!y.has(n.name)){if(n.isDirectory()){i(e?`${e}/${n.name}`:n.name);continue}o.has(p(n.name).toLowerCase())&&s.add(e?`${e}/${n.name}`:n.name)}};return i(""),s}export{j as a,y as b,w as c};
|
|
2
|
-
//# sourceMappingURL=chunk-PBGTMPJ7.js.map
|
package/dist/chunk-QYKKTYBN.js
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import{a as b}from"./chunk-IVAIPXNO.js";import{c as p}from"./chunk-PBGTMPJ7.js";import{f as g}from"./chunk-OH5HIAID.js";import{d as u}from"./chunk-VDZL45XI.js";import{readFileSync as j}from"fs";import{join as m}from"path";var k={files:new Set,pathPrefixes:[]},l=/^(?:dist|build|lib|out|output|esm|cjs|umd)\//,y=/\.(?:d\.ts|d\.mts|d\.cts|ts|tsx|mts|cts|js|jsx|mjs|cjs)$/,P=[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs"],w=u("package-surface",{clearGroups:["whole-project"]});function E(t){return w.get(t,()=>v(t.config.projectRoot))}function S(t,r){let e=E(t);return e.files.has(r)?!0:e.pathPrefixes.some(s=>r.startsWith(s))}function v(t){let r=D(t);if(!r)return k;let e=new Set,s=[];for(let i of $(r))R(i,e,s);return{files:e,pathPrefixes:s}}function D(t){try{let r=j(m(t,"package.json"),"utf-8"),e=JSON.parse(r);return e&&typeof e=="object"?e:null}catch{return null}}function $(t){let r=[];for(let s of["main","module","types","browser"])typeof t[s]=="string"&&r.push(t[s]);let e=t.bin;if(typeof e=="string")r.push(e);else if(e&&typeof e=="object")for(let s of Object.values(e))typeof s=="string"&&r.push(s);return x(t.exports,r),r}function x(t,r){if(typeof t=="string"){r.push(t);return}if(!(!t||typeof t!="object"))for(let e of Object.values(t))x(e,r)}function R(t,r,e){let s=t.replace(/\\/g,"/").replace(/^\.\//,"");if(s===""||s.startsWith(".."))return;let i=s.indexOf("*");if(i>=0){let o=s.slice(0,i);for(let a of h(o))a!==""&&e.push(a);return}let n=s.replace(y,"");for(let o of h(n)){o===n&&o===s&&r.add(s);for(let a of P)r.add(o+a)}r.add(s)}function h(t){let r=[t];return l.test(t)&&(r.push(t.replace(l,"src/")),r.push(t.replace(l,""))),r}function f(t){let r=c(t);return W(r)?"test":B(r)?"worker":A(r)?"entry":I(r)?"barrel":"source"}function T(t){return f(t)==="barrel"}function _(t){return F.get(t,()=>{let r=b(t),e=p(t).filter(n=>{let o=f(n);return o==="entry"||o==="worker"}),s=new Set,i=new Set;for(;e.length>0;){let n=e.shift();if(!s.has(n)){s.add(n),f(n)==="barrel"&&i.add(n);for(let o of r.get(n)??[])s.has(o)||e.push(o)}}return i})}var F=u("live-barrels",{clearGroups:["whole-project"]});function N(t,r){return _(t).has(c(r))}function Q(t){let r=_(t);return p(t).filter(e=>T(e)&&!r.has(e)&&!O(t,e))}function O(t,r){let e=c(r),s=g(t,e)?.callables;return s&&s.length>0?!0:(t.get(`SELECT COUNT(*) AS n
|
|
2
|
-
FROM defn_enclosing_ranges der
|
|
3
|
-
JOIN documents d ON d.id = der.document_id
|
|
4
|
-
WHERE d.relative_path = ?
|
|
5
|
-
AND der.end_line - der.start_line >= 2`,e)?.n??0)>0}function Y(t,r){let e=f(r);return e==="entry"||e==="worker"||N(t,r)}function Z(t,r,e){let s=c(e);if(S(t,s))return!0;let i=t.config.entryRoots;return i?!!(i.files?.some(n=>c(n)===s)||i.pathPrefixes?.some(n=>s.startsWith(c(n)))||i.qualifiedVars?.some(n=>C(r,n))||i.symbolPatterns?.some(n=>{try{return new RegExp(n).test(r)}catch{return!1}})):!1}function W(t){return!!(/\.(?:test|spec)\.[a-z0-9]+$/i.test(t)||/(?:^|\/)(?:_)?test_[^/]+$/i.test(t)||/(?:^|\/)spec_[^/]+$/i.test(t)||/(?:^|\/)[^/]+_test\.[a-z0-9]+$/i.test(t)||/(?:^|\/)[^/]+_tests\.rs$/i.test(t)||/(?:^|\/)tests\.rs$/i.test(t)||/(?:^|\/)[^/]+_spec\.[a-z0-9]+$/i.test(t)||/(?:^|\/)__tests__\//i.test(t)||/(?:^|\/)test\//i.test(t)||/(?:^|\/)tests\//i.test(t)||/(?:^|\/)__fixtures__\//i.test(t)||/(?:^|\/)__mocks__\//i.test(t)||/(?:^|\/)test-support\//i.test(t)||/(?:^|\/)test-utils\//i.test(t)||/(?:^|\/)testing\//i.test(t))}function B(t){return/(?:^|\/)[^/]*worker\.(?:ts|tsx|js|mjs|cjs|rs|py|go)$/.test(t)}function A(t){let r=t.split("/"),e=r[r.length-1]??t;return e==="cli.ts"||e==="cli.js"||e==="postinstall.ts"||e==="postinstall.js"||e==="main.ts"||e==="main.js"||e==="main.rs"||e==="main.go"||e==="main.py"||e==="build.rs"||e==="lib.rs"||/\bsrc\/bin\/[^/]+\.rs$/.test(t)||/(?:^|\/)examples\/[^/]+\.rs$/.test(t)||/(?:^|\/)tests\/[^/]+\.rs$/.test(t)||/(?:^|\/)benches\/[^/]+\.rs$/.test(t)?!0:e==="index.ts"||e==="index.js"?/(?:^|\/)(?:apps|services)\/[^/]+\/src\/index\.(?:ts|js)$/.test(t)?!0:r.length<=2:!1}function I(t){return t==="index.ts"||t==="index.js"||t.endsWith("/index.ts")||t.endsWith("/index.js")||t.endsWith("/mod.rs")||t.endsWith("/__init__.py")}function c(t){return t.replace(/\\/g,"/")}function C(t,r){let e=r.lastIndexOf("/");if(e<0)return!1;let s=r.slice(0,e),i=r.slice(e+1);return t.includes(d(s)+"/")&&t.includes(d(i)+".")}function d(t){return/^[A-Za-z0-9_$+-]+$/.test(t)?t:"`"+t.replace(/`/g,"``")+"`"}export{f as a,T as b,N as c,Q as d,Y as e,Z as f};
|
|
6
|
-
//# sourceMappingURL=chunk-QYKKTYBN.js.map
|
package/dist/chunk-R3G6ERW7.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import{d as b}from"./chunk-VDZL45XI.js";import{execFileSync as y}from"child_process";var A=2e3,F=50,R=/\b(?:fix(?:es|ed)?|bug|regression|hotfix)\b/i;function d(e){let n=b(e,{clearGroups:["whole-project"]});return(t,i)=>{let s=M(t.config.projectRoot);if(!s)return null;let r=n.has(t)?n.get(t,()=>({head:"",value:null})):null;return r&&r.head===s?r.value:(n.invalidate(t),n.get(t,()=>({head:s,value:i(t.config.projectRoot,s)})).value)}}var S=d("git-commit-history");function p(e){return S(e,w)}function M(e){try{return g(e,["rev-parse","HEAD"]).trim()||null}catch{return null}}function g(e,n){return y("git",["-C",e,...n],{encoding:"utf-8",maxBuffer:64*1024*1024,stdio:["ignore","pipe","ignore"]})}function w(e,n){let t;try{t=g(e,["log","--no-merges","--name-only","-n",String(A),"--pretty=format:%x01%H%x00%ct%x00%s"])}catch{return null}let i=[],s=0;for(let r of t.split("")){if(r.trim()==="")continue;let c=r.indexOf(`
|
|
2
|
-
`),f=c>=0?r.slice(0,c):r,[a,o,l]=f.split("\0");if(!a||!o)continue;let m=c>=0?r.slice(c+1).split(`
|
|
3
|
-
`).map(u=>u.trim()).filter(u=>u!==""):[];if(m.length>F){s+=1;continue}i.push({hash:a,timestamp:Number(o)||0,subject:l??"",files:m})}return{head:n,commits:i,skippedBulkCommits:s}}function k(e){return R.test(e.subject)}function B(e){let n=p(e);if(!n)return null;let t=new Map;for(let i of n.commits){let s=k(i);for(let r of i.files){let c=t.get(r)??{changes:0,fixChanges:0,lastChangedAt:0};c.changes+=1,s&&(c.fixChanges+=1),i.timestamp>c.lastChangedAt&&(c.lastChangedAt=i.timestamp),t.set(r,c)}}return t}function v(e){let n=p(e);if(!n||n.commits.length===0)return null;let t=n.commits.map(i=>i.files.length).filter(i=>i>0).sort((i,s)=>i-s);return t.length===0?null:{medianFilesPerCommit:x(t,.5),p90FilesPerCommit:x(t,.9),commitsAnalyzed:t.length}}function x(e,n){let t=Math.min(e.length-1,Math.floor(e.length*n));return e[t]}var P=d("git-tracked-files");function _(e){return P(e,n=>{try{let t=g(n,["ls-files"]);return new Set(t.split(`
|
|
4
|
-
`).map(i=>i.trim()).filter(i=>i!==""))}catch{return null}})}var T=d("git-file-adds");function E(e){return T(e,n=>j(n))}function j(e){let n;try{n=g(e,["log","--no-merges","--diff-filter=A","--name-only","-n",String(A),"--pretty=format:%x01%H%x00%ct%x00%s"])}catch{return null}let t=new Map,i=-1;for(let s of n.split("")){if(s.trim()==="")continue;i+=1;let r=s.indexOf(`
|
|
5
|
-
`),c=r>=0?s.slice(0,r):s,[,f]=c.split("\0"),a=Number(f)||0;if(!(r<0))for(let o of s.slice(r+1).split(`
|
|
6
|
-
`)){let l=o.trim();l!==""&&t.set(l,{commitsAgo:i,addedAt:a})}}return t}function I(e,n={}){let{minTogether:t=4,minConfidence:i=.6}=n,s=p(e);if(!s)return null;let r=new Map,c=new Map;for(let a of s.commits){let o=[...new Set(a.files)].sort();for(let l of o)r.set(l,(r.get(l)??0)+1);for(let l=0;l<o.length;l++)for(let m=l+1;m<o.length;m++){let u=`${o[l]}\0${o[m]}`;c.set(u,(c.get(u)??0)+1)}}let f=[];for(let[a,o]of c){if(o<t)continue;let[l,m]=a.split("\0"),u=r.get(l)??o,h=r.get(m)??o,C=Math.max(o/u,o/h);C<i||f.push({fileA:l,fileB:m,together:o,confidence:C,changesA:u,changesB:h})}return f.sort((a,o)=>o.together-a.together||o.confidence-a.confidence||a.fileA.localeCompare(o.fileA)),f}export{p as a,B as b,v as c,_ as d,E as e,I as f};
|
|
7
|
-
//# sourceMappingURL=chunk-R3G6ERW7.js.map
|
package/dist/chunk-SJR4SB7B.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as b}from"./chunk-V76FCF5F.js";import{a as g}from"./chunk-IW7ASGVF.js";import{a as d}from"./chunk-VGBSY6N7.js";import{c as p}from"./chunk-O6KCZPJQ.js";import{c as o,f as c}from"./chunk-OH5HIAID.js";function T(t,r={}){let{scope:l,limit:s=30,scanLimit:f}=r,u=r.files===void 0?null:new Set(r.files),L=new g(t);return b({candidates:()=>L.productionCallableDefinitions({scope:l,minLoc:2,excludeRootedSymbols:!0,requireFunctionLikeSymbol:!0}).filter(e=>h(e.relativePath)&&(u===null||u.has(e.relativePath))),scanLimit:f,evaluate:e=>{let n=c(t,e.relativePath)?.callables.find(a=>a.startLine===e.startLine&&a.endLine===e.endLine);if(!n||n.params.length===0||n.params.some(a=>!a.simple)||n.paramsEndLine>=n.endLine)return null;let y=d(t,e.relativePath),m=[];for(let a=n.params.length-1;a>=0;a--){let i=n.params[a];if(i.name===""||i.name.startsWith("_")||P(y.get(i.name),n.paramsEndLine,n.endLine))break;m.unshift(i.name)}return m.length===0?null:{symbol:e.symbol,shortName:p(e.symbol),file:e.relativePath,startLine:e.startLine,endLine:e.endLine,paramCount:n.paramCount,unusedTrailing:m}},orderResults:(e,n)=>n.unusedTrailing.length-e.unusedTrailing.length||e.file.localeCompare(n.file)||e.startLine-n.startLine,limit:s})}function h(t){let r=o(t);return r==="typescript"||r==="tsx"||r==="javascript"}function P(t,r,l){return t?t.some(s=>s>r&&s<=l):!1}export{T as a};
|
|
2
|
-
//# sourceMappingURL=chunk-SJR4SB7B.js.map
|
package/dist/chunk-SYKCO25G.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import{a as h}from"./chunk-IW7ASGVF.js";import{e as y}from"./chunk-ZF6P2NAT.js";import{c as g,f as d,h as p}from"./chunk-O6KCZPJQ.js";import{execFileSync as u}from"child_process";var I="Unable to compute git diff.";function k(e,n={}){let t=S(e,n);return t.note?F(t.note,t.changedFileLines):t.changedFiles.length===0?_(t.changedFileLines):D(t.changedFiles,[C(e,t.changedFiles,t.changedFiles)])}function S(e,n={}){let{base:t="HEAD"}=n;try{let s=x(e.config.projectRoot,t);return{changedFileLines:s,changedFiles:N(e,s),note:s.length===0?"No changed files found.":void 0}}catch{return{changedFileLines:[],changedFiles:[],note:I}}}function C(e,n,t){let s=new h(e),o=new Set(t),a=[],l=new Map,i=n.flatMap(r=>s.definitionsForFile(r)).filter(w).sort((r,f)=>r.relativePath.localeCompare(f.relativePath)||r.startLine-f.startLine),m=new Map(i.map(r=>[r.symbolId,M(e,r.symbolId)])),c=y(e,i.filter(r=>m.get(r.symbolId)===0));for(let r of i)E(e,r,t,o,a,l,c.get(r.symbolId)??new Set,m.get(r.symbolId)??0);return{changedSymbols:a,consumerEntries:[...l.entries()].map(([r,f])=>({file:r,symbols:[...f].sort()}))}}function D(e,n){let t=new Map,s=n.flatMap(a=>a.changedSymbols);for(let a of n)for(let l of a.consumerEntries){let i=t.get(l.file);i||(i=new Set,t.set(l.file,i));for(let m of l.symbols)i.add(m)}let o=L(t);return{changedFiles:[...e],changedSymbols:s,affectedConsumers:o,summary:{totalChangedFiles:e.length,totalChangedSymbols:s.length,totalAffectedFiles:o.length}}}function F(e,n=[]){return{changedFiles:n,changedSymbols:[],affectedConsumers:[],summary:{totalChangedFiles:n.length,totalChangedSymbols:0,totalAffectedFiles:0,note:e}}}function _(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 x(e,n){let t=u("git",["diff","--name-only",n],{encoding:"utf-8",cwd:e,timeout:1e4}),s=u("git",["diff","--name-only","--cached",n],{encoding:"utf-8",cwd:e,timeout:1e4}),o=u("git",["ls-files","--others","--exclude-standard"],{encoding:"utf-8",cwd:e,timeout:1e4});return[...new Set([t,s,o].flatMap(a=>a.split(`
|
|
2
|
-
`)).map(a=>a.trim()).filter(a=>a.length>0))]}function N(e,n){let t=[];for(let s of n){let o=e.get(`SELECT relative_path FROM documents
|
|
3
|
-
WHERE relative_path LIKE ?
|
|
4
|
-
LIMIT 1`,`%${s}`);o&&!e.isIgnored(o.relative_path)&&t.push(o.relative_path)}return t}function E(e,n,t,s,o,a,l,i){let m=Math.max(i,l.size);if(!A(n,m))return;let c=g(n.symbol);o.push({symbol:n.symbol,shortName:c,file:n.relativePath,fanIn:m});for(let r of R(e,n.symbolId,t))b(e,s,a,r,c);for(let r of l)b(e,s,a,r,c)}function M(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 R(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(o=>o.relative_path)}function b(e,n,t,s,o){if(e.isIgnored(s)||n.has(s))return;let a=t.get(s);a||(a=new Set,t.set(s,a)),a.add(o)}function L(e){return[...e.entries()].map(([n,t])=>({file:n,consumedSymbols:t.size})).sort((n,t)=>t.consumedSymbols-n.consumedSymbols)}function w(e){return!(p(e.symbol)||e.parentTypeName!==null&&!d(e.symbol))}function A(e,n){return d(e.symbol)||e.isTypeLike?!0:e.parentTypeName===null&&n>0}export{I as a,k as b,S as c,C as d,D as e};
|
|
16
|
-
//# sourceMappingURL=chunk-SYKCO25G.js.map
|
package/dist/chunk-T22X7WT6.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{c as m}from"./chunk-UIWAZ2NT.js";import{a as d}from"./chunk-IVAIPXNO.js";function v(t,s={}){let{minSimilarity:o=.5,limit:f=20,scope:n,filePattern:p}=s,l=s.minDeps??(p?1:3),{profiles:e,distinctiveDeps:c}=h(t,{scope:n,minDeps:l}),i=[];if(p){let r=e.find(u=>u.file.includes(p));if(!r)return[];for(let u of e){if(u.file===r.file)continue;let a=g(r,u,o,c);a&&i.push(a)}}else for(let r=0;r<e.length;r++){for(let u=r+1;u<e.length;u++){let a=g(e[r],e[u],o,c);a&&i.push(a)}if(i.length>f*5)break}return i.sort((r,u)=>u.similarity-r.similarity),i.slice(0,f)}function h(t,s){let{scope:o,minDeps:f}=s,n=d(t,o),{universalDeps:p,distinctiveDeps:l}=D(n),e=[];for(let[c,i]of n)i.size>=f&&e.push({file:c,deps:new Set([...i].filter(r=>!p.has(r)))});return{profiles:e,distinctiveDeps:l}}function D(t){let s=new Set,o=new Set,f=t.size;if(f===0)return{universalDeps:s,distinctiveDeps:o};let n=new Map;for(let l of t.values())for(let e of l)n.set(e,(n.get(e)??0)+1);let p=Math.max(3,Math.ceil(f*.03));for(let[l,e]of n)e>=5&&e/f>.3?s.add(l):e<=p&&o.add(l);return{universalDeps:s,distinctiveDeps:o}}function g(t,s,o,f){let n=new Set;for(let i of t.deps)s.deps.has(i)&&n.add(i);if(n.size<3||t.deps.size<4||s.deps.size<4)return null;let p=0;for(let i of n)f.has(i)&&p++;if(p<2)return null;let l=m(t.deps,s.deps);if(l<o)return null;let e=[];for(let i of t.deps)s.deps.has(i)||e.push(i);let c=[];for(let i of s.deps)t.deps.has(i)||c.push(i);return{fileA:t.file,fileB:s.file,similarity:l,sharedDeps:[...n],uniqueToA:e,uniqueToB:c}}export{v as a};
|
|
2
|
-
//# sourceMappingURL=chunk-T22X7WT6.js.map
|
package/dist/chunk-TH4JVC34.js
DELETED
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import Pe from"better-sqlite3";import{existsSync as Ot,readFileSync as At,writeFileSync as Pt}from"fs";import{dirname as Mt,join as _t,resolve as Ne}from"path";import te from"better-sqlite3";import{execFileSync as ne}from"child_process";import{existsSync as re,readdirSync as oe,readFileSync as ie}from"fs";import{extname as m,join as F}from"path";import K from"ignore";import{readFileSync as U,existsSync as b}from"fs";import{dirname as h,isAbsolute as V,join as S,relative as B,resolve as J}from"path";function C(e){let t=K(),r=!1,n=z(e);for(let i of n)try{let o=U(i,"utf-8");t.add(o),r=!0}catch{}return r||t.add(X),{isIgnored:i=>x(t,e,i),filter:i=>i.filter(o=>!x(t,e,o))}}function z(e){let t=[],r=S(e,".gitignore");b(r)&&t.push(r);let n=h(e),i=0;for(;n!==h(n)&&i<5;){let o=S(n,".gitignore");if(b(o)&&t.push(o),b(S(n,".git")))break;n=h(n),i++}return t}var X=`
|
|
2
|
-
# Dependencies
|
|
3
|
-
node_modules/
|
|
4
|
-
vendor/
|
|
5
|
-
.bundle/
|
|
6
|
-
|
|
7
|
-
# Build output
|
|
8
|
-
dist/
|
|
9
|
-
build/
|
|
10
|
-
out/
|
|
11
|
-
target/
|
|
12
|
-
bin/
|
|
13
|
-
obj/
|
|
14
|
-
|
|
15
|
-
# Python
|
|
16
|
-
__pycache__/
|
|
17
|
-
*.pyc
|
|
18
|
-
*.pyo
|
|
19
|
-
.venv/
|
|
20
|
-
venv/
|
|
21
|
-
.env/
|
|
22
|
-
env/
|
|
23
|
-
*.egg-info/
|
|
24
|
-
|
|
25
|
-
# Rust
|
|
26
|
-
target/
|
|
27
|
-
|
|
28
|
-
# Java / Kotlin / Scala
|
|
29
|
-
*.class
|
|
30
|
-
.gradle/
|
|
31
|
-
.mvn/
|
|
32
|
-
|
|
33
|
-
# C# / .NET
|
|
34
|
-
bin/
|
|
35
|
-
obj/
|
|
36
|
-
packages/
|
|
37
|
-
|
|
38
|
-
# Go
|
|
39
|
-
vendor/
|
|
40
|
-
|
|
41
|
-
# Dart
|
|
42
|
-
.dart_tool/
|
|
43
|
-
build/
|
|
44
|
-
|
|
45
|
-
# PHP
|
|
46
|
-
vendor/
|
|
47
|
-
|
|
48
|
-
# IDE / OS
|
|
49
|
-
.idea/
|
|
50
|
-
.vscode/
|
|
51
|
-
*.swp
|
|
52
|
-
*.swo
|
|
53
|
-
.DS_Store
|
|
54
|
-
Thumbs.db
|
|
55
|
-
|
|
56
|
-
# Type definitions (often noise in queries)
|
|
57
|
-
*.d.ts
|
|
58
|
-
`;function x(e,t,r){let n=q(t,r);if(!n)return!1;try{return e.ignores(n)}catch{return!1}}function q(e,t){if(!t||t===".")return null;if(!V(t)&&!t.startsWith(".."))return t.replaceAll("\\","/");let r=V(t)?t:J(e,t),n=B(e,r).replaceAll("\\","/");return!n||n==="."||n.startsWith("..")?null:n}import{readdirSync as Ze}from"fs";import{extname as tt,join as nt}from"path";var Y=[];function k(e){e.groups.length>0&&Y.push(e)}function Q(){let e=new WeakMap;return{cache:e,ensure(t){let r=e.get(t);return r||(r=new Map,e.set(t,r)),r}}}function T(e,t){let{cache:r,ensure:n}=Q(),i={get(o,s,a){let u=n(o);if(u.has(s))return u.get(s);let c=a();return u.set(s,c),c},invalidate(o,s){r.get(o)?.delete(s)},invalidateAll(o){r.delete(o)},size(o){return r.get(o)?.size??0}};return k({name:e,groups:t.clearGroups,clearAll:o=>i.invalidateAll(o),clearFile:(o,s)=>i.invalidate(o,s)}),i}var Z=[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs",".vue",".rs",".py",".pyi",".java",".kt",".kts",".scala",".sc",".rb",".c",".h",".cc",".cpp",".cxx",".hpp",".hh",".hxx",".cs",".vb",".php",".dart"],L=[".vue"],ee=new Set(Z.map(e=>e.toLowerCase())),ot=[...ee].sort().join(","),D=new Set(["node_modules",".git","target","dist","build",".next",".nuxt",".cache",".turbo","out","coverage",".scipquery-cache","__pycache__",".venv","venv",".idea",".vscode"]);var it=T("source-files",{clearGroups:[]});function ft(e){let t=new Set((e.extensions??L).map(o=>o.toLowerCase()));if(t.size===0)return{scanned:0,inserted:0,existing:0};if(!re(e.dbPath))throw new Error(`SCIP SQLite database not found at ${e.dbPath}`);let r=C(e.projectRoot),n=se(e.projectRoot,t).filter(o=>!r.isIgnored(o)),i=new te(e.dbPath);try{let o=ue(i,n),s=i.prepare(`INSERT OR IGNORE INTO documents (language, relative_path, position_encoding, text)
|
|
59
|
-
VALUES (?, ?, NULL, ?)`),u=i.transaction(l=>{let p=0;for(let g of l){if(o.has(g))continue;let d=ie(F(e.projectRoot,g),"utf-8"),H=s.run(ce(g),g,d);p+=Number(H.changes)}return p})(n),c={scanned:n.length,inserted:u,existing:n.length-u};return e.onStatus?.(`Augmented SQLite documents with ${u} auxiliary source file${u===1?"":"s"} (${c.existing} already present).`),c}finally{i.close()}}function se(e,t){let r=ae(e,t);if(r)return r;let n=[],i=o=>{let s=o?F(e,o):e,a;try{a=oe(s,{withFileTypes:!0})}catch{return}for(let u of a){if(D.has(u.name))continue;let c=o?`${o}/${u.name}`:u.name;if(u.isDirectory()){i(c);continue}t.has(m(u.name).toLowerCase())&&n.push(c)}};return i(""),n.sort()}function ae(e,t){try{return ne("git",["-C",e,"ls-files","-co","--exclude-standard","--","."],{encoding:"utf-8",maxBuffer:26214400,stdio:["ignore","pipe","ignore"]}).split(`
|
|
60
|
-
`).filter(n=>n&&t.has(m(n).toLowerCase())).sort()}catch{return null}}function ue(e,t){let r=new Set,n=500;for(let i=0;i<t.length;i+=n){let o=t.slice(i,i+n),s=e.prepare(`SELECT relative_path FROM documents WHERE relative_path IN (${o.map(()=>"?").join(",")})`).all(...o);for(let a of s)r.add(a.relative_path)}return r}function ce(e){return m(e).toLowerCase()===".vue"?"vue":m(e).replace(/^\./,"").toLowerCase()||"source"}import{execFileSync as le}from"child_process";import{createHash as ge}from"crypto";import{readdirSync as de,readFileSync as fe}from"fs";import{join as I}from"path";function pe(e){return(me(e)??be(e)).filter(t=>t&&!w(t)).sort()}function yt(e){return pe(e).map(t=>{let r=I(e,t);try{let n=fe(r);return{path:t,size:n.byteLength,hash:ge("sha256").update(n).digest("hex")}}catch{return{path:t,size:-1,hash:"unreadable"}}})}function me(e){try{return le("git",["-C",e,"ls-files","-co","--exclude-standard","--","."],{encoding:"utf-8",maxBuffer:50*1024*1024,stdio:["ignore","pipe","ignore"]}).split(`
|
|
61
|
-
`).filter(Boolean)}catch{return null}}function be(e){let t=[],r=[""];for(;r.length>0;){let n=r.pop(),i=n?I(e,n):e,o;try{o=de(i,{withFileTypes:!0})}catch{continue}for(let s of o){let a=n?`${n}/${s.name}`:s.name;if(s.isDirectory()){w(a)||r.push(a);continue}t.push(a)}}return t}function w(e){return e.split("/").some(r=>he.has(r))||e.endsWith(".db")||e.endsWith(".db-wal")||e.endsWith(".db-shm")||e.endsWith(".scip")}var he=new Set([".git","node_modules",".scipquery-cache",".stryker-tmp","dist","build","coverage",".next",".nuxt","target"]);import{createRequire as Se}from"module";import{existsSync as ye,readFileSync as v}from"fs";import{dirname as E,extname as ve,join as O,relative as Re,resolve as Ct}from"path";import{pathToFileURL as Ve}from"url";function A(e,t){let{vueCore:r,ts:n,volarTs:i}=xe(e),{parsed:o,vueOptions:s}=Ce(r,n,t),a=E(t),u=r.createVueLanguagePlugin(n,o.options,s,d=>d),c=ke(r,n,u),l=Te(a,o),{languageServiceHost:p}=i.createLanguageServiceHost(n,n.sys,c,d=>d,l),g=n.createLanguageService(p);return{ts:n,language:c,languageService:g,fileNames:o.fileNames,configDir:a}}function xe(e){let t=Se(Ve(O(e,"package.json")).href);return{vueCore:y(t,"@vue/language-core",e),ts:y(t,"typescript",e),volarTs:y(t,"@volar/typescript",e)}}function Ce(e,t,r){let n=t.readConfigFile(r,t.sys.readFile);if(n.error||!n.config)throw new Error(`Failed to read ${r}`);let o=e.createParsedCommandLine(t,t.sys,r).vueOptions;return typeof e.createGlobalTypesWriter=="function"&&(o.globalTypesPath=e.createGlobalTypesWriter(o,t.sys.writeFile)),{parsed:t.parseJsonConfigFileContent(n.config,t.sys,E(r),void 0,r,void 0,e.getAllExtensions(o).map(s=>({extension:s.slice(1),isMixedContent:!0,scriptKind:t.ScriptKind.Deferred}))),vueOptions:o}}function ke(e,t,r){let n={},i=e.createLanguage([r],new Map,o=>{if(!ye(o))return;let s=v(o,"utf-8");n.current?.scripts.set(o,t.ScriptSnapshot.fromString(s),r.getLanguageId(o)??Ie(o))});return n.current=i,i}function Te(e,t){return{getCurrentDirectory:()=>e,getCompilationSettings:()=>t.options,getScriptFileNames:()=>t.fileNames,getProjectReferences:()=>t.projectReferences,getProjectVersion:()=>"0"}}function y(e,t,r){try{return e(t)}catch(n){throw(typeof n=="object"&&n!==null&&"code"in n?n.code:null)==="MODULE_NOT_FOUND"?new Error(`Vue augmentation requires ${t} to be installed in ${r}. Install Vue/Volar dependencies for that project, then rerun augment-vue.`,{cause:n}):n}}function P(e,t,r){let n=Le(e);return i=>{let o=f(t,i.fileName),s=r.get(i.fileName);if(!s)return null;let a=r.positionAt(s,i.textSpan.start),u=n.get(o);if(!u)return null;let c=u.containingByLine.get(a.line);return c!==void 0?c:De(u.starts,a.line,2)}}function Le(e){let t=e.prepare(`
|
|
62
|
-
SELECT
|
|
63
|
-
d.relative_path AS relativePath,
|
|
64
|
-
der.start_line AS startLine,
|
|
65
|
-
der.end_line AS endLine,
|
|
66
|
-
der.symbol_id AS symbolId
|
|
67
|
-
FROM defn_enclosing_ranges der
|
|
68
|
-
JOIN documents d ON d.id = der.document_id
|
|
69
|
-
ORDER BY d.relative_path, (der.end_line - der.start_line) DESC
|
|
70
|
-
`).all(),r=new Map;for(let n of t){let i=r.get(n.relativePath);i||(i={containingByLine:new Map,starts:[]},r.set(n.relativePath,i)),i.starts.push({line:n.startLine,symbolId:n.symbolId});for(let o=n.startLine;o<=n.endLine;o++)i.containingByLine.set(o,n.symbolId)}for(let n of r.values())n.starts.sort((i,o)=>i.line-o.line);return r}function De(e,t,r){let n=0,i=e.length-1;for(;n<=i;){let s=Math.floor((n+i)/2);e[s].line<t?n=s+1:i=s-1}let o=null;for(let s of[i,n]){let a=e[s];if(!a)continue;let u=Math.abs(a.line-t);u>r||(!o||u<o.distance)&&(o={distance:u,symbolId:a.symbolId})}return o?.symbolId??null}function N(e,t){let r=Ee(t),n=e.prepare("SELECT id FROM global_symbols WHERE symbol = ?"),i=new Map;return{get(o){if(i.has(o))return i.get(o)??null;let s=Oe(n,r,t,o);return i.set(o,s),s}}}function M(e,t,r,n,i){if(e.fileName.endsWith(".vue")){let o=n.language.scripts.get(e.fileName),s=o?.generated?.languagePlugin.typescript?.getServiceScript(o.generated.root)?.code;if(o&&s){let a=n.language.maps.get(s,o);if(R(a,e.textSpan.start)!==null)return r.get(e.fileName)}return e.fileName.startsWith(i)?r.get(e.fileName):null}return t(e)}function*_(e){let t=/\b[A-Za-z_$][A-Za-z0-9_$]*\b/g,r=new Set(["script","setup","template","style","lang","scoped","true","false","null","undefined","const","let","var","import","from","export","return","if","else","for","while","function","class","type","interface","as","await","async"]),n;for(;n=t.exec(e);){let i=n[0];r.has(i)||(yield{text:i,start:n.index,end:n.index+i.length})}}function j(e,t){for(let[r]of e.toGeneratedLocation(t,n=>!!n.navigation))return r;return null}function R(e,t){let r=e;for(let[n]of r.toSourceLocation(t,i=>!!i.navigation))return n;return null}function Fe(e,t){let r=0,n=e.lineStarts.length-1;for(;r<=n;){let o=Math.floor((r+n)/2);e.lineStarts[o]<=t?r=o+1:n=o-1}let i=Math.max(0,n);return{line:i,character:t-e.lineStarts[i]}}function G(e,t){return f(e,t).startsWith("node_modules/")}function f(e,t){return Re(e,t).replaceAll("\\","/")}function Ie(e){switch(ve(e)){case".vue":return"vue";case".tsx":return"typescriptreact";case".ts":case".mts":case".cts":return"typescript";case".jsx":return"javascriptreact";case".js":case".mjs":case".cjs":return"javascript";case".json":return"json";default:return"typescript"}}function $(){let e=new Map;return{get(t){if(e.has(t))return e.get(t)??null;try{let r=v(t,"utf-8"),n={text:r,lineStarts:we(r)};return e.set(t,n),n}catch{return e.set(t,null),null}},positionAt:Fe}}function we(e){let t=[0];for(let r=0;r<e.length;r++)e.charCodeAt(r)===10&&t.push(r+1);return t}function Ee(e){try{let t=JSON.parse(v(O(e,"package.json"),"utf-8"));return{name:t.name??"workspace",version:t.version??"0.0.0"}}catch{return{name:"workspace",version:"0.0.0"}}}function Oe(e,t,r,n){let i=f(r,n),o=Ae(t.name,t.version,i);return e.get(o)?.id??null}function Ae(e,t,r){let n=r.split("/").map(i=>`\`${i.replaceAll("`","")}\``).join("/");return`scip-vue npm ${e} ${t} ${n}/default.`}function Gt(e){let t=Ne(e.projectRoot,e.tsconfig),r=new Pe(e.dbPath,{readonly:!0});try{let n=Me({db:r,projectRoot:e.projectRoot,configPath:t,vueSymbolLookup:N(r,e.projectRoot)});return _e({vueFiles:e.vueFiles??[],tasks:e.tasks,...n})}finally{r.close()}}function Me(e){let t=$();return{projectRoot:e.projectRoot,context:A(e.projectRoot,e.configPath),symbolLookup:P(e.db,e.projectRoot,t),vueSymbolLookup:e.vueSymbolLookup,sourceReader:t}}function _e(e){let t=[],r=0,n=e.tasks??e.vueFiles.map(i=>({fileName:i,startOffset:0,endOffset:Number.POSITIVE_INFINITY,countFileSkip:!0}));for(let i of n){let o=je(e,i);t.push(...o.occurrences),r+=o.skippedReferences}return{occurrences:t,skippedReferences:r}}function je(e,t){let r=e.context.language.scripts.get(t.fileName),n=r?.generated?.languagePlugin.typescript?.getServiceScript(r.generated.root)?.code;if(!r||!n)return{occurrences:[],skippedReferences:t.countFileSkip?1:0};let i=e.sourceReader.get(t.fileName);if(!i)return{occurrences:[],skippedReferences:t.countFileSkip?1:0};let o=e.context.language.maps.get(n,r),s=f(e.projectRoot,t.fileName),a=[..._(i.text)],u={tokens:a.filter(c=>c.start>=t.startOffset&&c.start<t.endOffset),tokenByStart:new Map(a.map(c=>[c.start,c])),tokenTextCounts:We(a),processedStarts:new Set};return Ge({...e,fileName:t.fileName,sourceInfo:i,sourceFile:s,map:o,tokenContext:u})}function Ge(e){let t=[],r=0;for(let n of e.tokenContext.tokens){if(e.tokenContext.processedStarts.has(n.start))continue;let i=j(e.map,n.start);if(i===null)continue;let s=(e.context.languageService.getDefinitionAtPosition(e.fileName,i+1)??[]).find(u=>!G(e.projectRoot,u.fileName));if(!s){r++;continue}let a=M(s,e.symbolLookup,e.vueSymbolLookup,e.context,e.projectRoot);if(a===null){r++;continue}W(t,e.sourceReader,e.sourceInfo,e.sourceFile,n,a),e.tokenContext.processedStarts.add(n.start),$e(t,e,n,i,a)}return{occurrences:t,skippedReferences:r}}function $e(e,t,r,n,i){if(!((t.tokenContext.tokenTextCounts.get(r.text)??0)<=1))for(let o of He(t.context.languageService,t.fileName,n+1,t.map,r,t.tokenContext.tokenByStart)){if(t.tokenContext.processedStarts.has(o))continue;let s=t.tokenContext.tokenByStart.get(o);s&&(W(e,t.sourceReader,t.sourceInfo,t.sourceFile,s,i),t.tokenContext.processedStarts.add(o))}}function W(e,t,r,n,i,o){let s=t.positionAt(r,i.start);e.push({sourceFile:n,sourceLine:s.line,sourceStartChar:s.character,sourceEndChar:s.character+i.text.length,symbolId:o})}function We(e){let t=new Map;for(let r of e)t.set(r.text,(t.get(r.text)??0)+1);return t}function He(e,t,r,n,i,o){let s=e.getDocumentHighlights?.(t,r,[t])??[],a=[];for(let u of s)if(u.fileName===t)for(let c of u.highlightSpans){let l=Ke(n,c.textSpan.start,o,i.text);l!==null&&a.push(l)}return a}function Ke(e,t,r,n){let i=r.get(t);if(i?.text===n)return i.start;let o=R(e,t);if(o===null)return null;let s=r.get(o);return s?.text===n?s.start:null}export{ft as a,yt as b,Gt as c};
|
|
71
|
-
//# sourceMappingURL=chunk-TH4JVC34.js.map
|
package/dist/chunk-VDY4HYNK.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as b}from"./chunk-V76FCF5F.js";import{a as c,b as f}from"./chunk-MX6F756F.js";import{a as u}from"./chunk-IW7ASGVF.js";import{c as a,g as l}from"./chunk-O6KCZPJQ.js";import{g as d}from"./chunk-OH5HIAID.js";function D(i,e){let{scope:n,maxLoc:t=15,limit:r=30,scanLimit:g}=e??{},m=new u(i);return b({candidates:()=>y(m,n,t),orderCandidates:f,scanLimit:g,prepare:o=>m.calleeMap(o,{semantic:e?.semantic!==!1}),evaluate:(o,s)=>p(i,o,s.get(o.symbolId)??[]),orderResults:(o,s)=>o.loc-s.loc||o.file.localeCompare(s.file),limit:r})}function p(i,e,n){let t=h(n);if(t.size!==1||!d(i,e.relativePath,e.startLine,e.endLine))return null;let[,r]=[...t.entries()][0];return{symbol:e.symbol,shortName:a(e.symbol),file:e.relativePath,startLine:e.startLine,endLine:e.endLine,loc:c(e),forwardsTo:r.symbol,forwardsToShort:a(r.symbol),forwardsToFile:r.file}}function h(i){let e=i.some(t=>l(t.symbol))?i.filter(t=>l(t.symbol)):i,n=new Map;for(let t of e)n.has(t.symbol)||n.set(t.symbol,t);return n}function y(i,e,n){return i.productionCallableDefinitions({scope:e,minLoc:3,maxLoc:n,requireFunctionLikeSymbol:!0,excludeRootedSymbols:!0,excludeRustTraitImplMembers:!0})}export{D as a};
|
|
2
|
-
//# sourceMappingURL=chunk-VDY4HYNK.js.map
|
package/dist/chunk-VDZIEDJB.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{b as h}from"./chunk-5QJIEYFB.js";import{e as y,g as S,h as g,i as M,m as C}from"./chunk-VGBSY6N7.js";import{e as R}from"./chunk-ZF6P2NAT.js";import{s as b}from"./chunk-O6KCZPJQ.js";import{c as f,i as m,k as p}from"./chunk-OH5HIAID.js";import{a as u}from"./chunk-NN3O7TPH.js";function D(e,n,t={}){let o=new Map;if(n&&n.length===0)return o;let i=u(e,{includeIgnored:!1}),a=M(e),r=n??b(e),l=new Set(r.map(s=>s.symbolId));return k(e,o,i,a,l),I(e,o,r,l),x(e,o,i,a,l),t.semantic!==!1&&_(o,R(e,A(r))),o}function k(e,n,t,o,i){for(let a of t){if(!f(a))continue;let r=m(e,a);if(r)for(let l of r){let s=S(a,o.get(l.calleeLeaf)??[]);if(!s||s.length===0)continue;let c=g(e,a,s,l.memberAccess);c&&i.has(c.symbolId)&&c.file!==a&&d(n,c.symbolId,a)}}}function I(e,n,t,o){let i=v(t);for(let a of L(e,o))e.isIgnored(a.relative_path)||w(a,i.get(a.symbol_id))||d(n,a.symbol_id,a.relative_path)}function L(e,n){return y(e,n?[...n]:void 0)}function v(e){let n=new Map;for(let t of e)n.set(t.symbolId,{docId:t.documentId,startLine:t.startLine,endLine:t.endLine});return n}function w(e,n){return!!n&&n.docId===e.document_id&&e.chunk_start>=n.startLine&&e.chunk_end<=n.endLine}function x(e,n,t,o,i){for(let a of t){if(f(a)!=="rust")continue;let r=p(e,a,{includeRustAttributeNames:!0});if(r.length!==0)for(let{name:l}of r){let s=o.get(l);if(s)for(let c of s)i.has(c.symbolId)&&c.file!==a&&d(n,c.symbolId,a)}}}function d(e,n,t){let o=e.get(n);o||(o=new Set,e.set(n,o)),o.add(t)}function A(e){return e.filter(n=>"relativePath"in n&&"symbol"in n&&"leaf"in n)}function _(e,n){for(let[t,o]of n){let i=e.get(t);i||(i=new Set,e.set(t,i));for(let a of o)i.add(a)}}function O(e,n,t={}){return h(e,n,t)}function F(e,n,t={}){return D(e,n,t)}function j(e,n){return C(e,n)}function Q(e,n,t={}){let o=F(e,n,{semantic:t.semantic});return t.sourceFallback===!1?o:V(o,j(e,n))}function V(e,n){let t=new Map;for(let[o,i]of e)t.set(o,new Set(i));for(let[o,i]of n){let a=t.get(o)??new Set;for(let r of i)a.add(r);t.set(o,a)}return t}export{O as a,F as b,j as c,Q as d};
|
|
2
|
-
//# sourceMappingURL=chunk-VDZIEDJB.js.map
|
package/dist/chunk-VDZL45XI.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
var b=[];function p(i){i.groups.length>0&&b.push(i)}function h(i,c){let a=new Set(c.groups);for(let n of b)n.groups.some(t=>a.has(t))&&(c.file!==void 0&&n.clearFile?n.clearFile(i,c.file):n.clearAll(i))}function g(){let i=new WeakMap;return{cache:i,ensure(c){let a=i.get(c);return a||(a=new Map,i.set(c,a)),a}}}function C(i,c){let{cache:a,ensure:n}=g(),t={get(e,r,s){let l=n(e);if(l.has(r))return l.get(r);let o=s();return l.set(r,o),o},invalidate(e,r){a.get(e)?.delete(r)},invalidateAll(e){a.delete(e)},size(e){return a.get(e)?.size??0}};return p({name:i,groups:c.clearGroups,clearAll:e=>t.invalidateAll(e),clearFile:(e,r)=>t.invalidate(e,r)}),t}function V(i,c){let a=new WeakMap,n={get(t,e){let r=a.get(t);if(r)return r.value;let s=e();return a.set(t,{value:s}),s},invalidate(t){a.delete(t)},has(t){return a.has(t)}};return p({name:i,groups:c.clearGroups,clearAll:t=>n.invalidate(t)}),n}function f(i,c){let{cache:a,ensure:n}=g(),t={get(e,r,s,l){let o=n(e),u=o.get(r);if(u&&u.source===s)return u.value;let d=l();return o.set(r,{source:s,value:d}),d},invalidate(e,r){a.get(e)?.delete(r)},invalidateAll(e){a.delete(e)}};return p({name:i,groups:c.clearGroups,clearAll:e=>t.invalidateAll(e),clearFile:(e,r)=>t.invalidate(e,r)}),t}export{p as a,h as b,C as c,V as d,f as e};
|
|
2
|
-
//# sourceMappingURL=chunk-VDZL45XI.js.map
|
package/dist/chunk-WJIS6BNI.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{a as b}from"./chunk-FVVT7GV6.js";import{d as x}from"./chunk-O6KCZPJQ.js";import{a as d,c as g,e as y}from"./chunk-OH5HIAID.js";import{c as u}from"./chunk-VDZL45XI.js";var S=u("definition-consumer-file-usage",{clearGroups:["whole-project","source-file"]});function I(t,e,n){return t.callerFileMap(e,{semantic:n.semantic,sourceFallback:n.sourceFallback})}function P(t,e,n){let r=[],i=0,s=0,p=x(e.symbol);for(let a of n)D(t,a,e.relativePath,p)?i++:C(t,a,p)?s++:r.push(a);return{realConsumers:r,barrelConsumers:i,importOnlyConsumers:s}}function C(t,e,n){if(!n)return!1;let r=g(e);if(!r)return!1;let i=S.get(t,e,()=>v(t,e,r));return i.importedLeaves.has(n)&&!i.usedLeaves.has(n)}function v(t,e,n){let r=new Set,i=new Set,s=y(t,e);if(!s)return{importedLeaves:r,usedLeaves:i};let p=n==="rust"?new Set(["use_declaration"]):n==="python"?new Set(["import_statement","import_from_statement"]):new Set(["import_statement"]),a=(o,f)=>{let c=f||p.has(o.type);(o.type==="identifier"||o.type==="type_identifier"||o.type==="property_identifier"||o.type==="field_identifier")&&(c?r.add(o.text):i.add(o.text));for(let l of o.children)a(l,c)};return a(s.rootNode,!1),{importedLeaves:r,usedLeaves:i}}function D(t,e,n,r){if(!r)return!1;let i=d(t,e);if(!i)return!1;let s=b(t,e);if(s.length===0)return!1;let p=r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),a=new RegExp(`\\b${p}\\b`),o=i.split(`
|
|
2
|
-
`),f=0;for(let c=0;c<o.length;c++){if(!a.test(o[c]??""))continue;if(f++,!s.find(m=>m.startLine<=c&&c<=m.endLine))return!1}return f>0}export{I as a,P as b,C as c};
|
|
3
|
-
//# sourceMappingURL=chunk-WJIS6BNI.js.map
|
package/dist/chunk-WN5Z3UVT.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import{a as D,b as L}from"./chunk-WJIS6BNI.js";import{a as M}from"./chunk-V76FCF5F.js";import{a as C,b as F}from"./chunk-MX6F756F.js";import{a as I}from"./chunk-IW7ASGVF.js";import{a as b}from"./chunk-VGBSY6N7.js";import{c as m,d,j as p,v as g}from"./chunk-O6KCZPJQ.js";import{basename as u,extname as f}from"path";function q(t,n){let{scope:e,maxLoc:r=15,limit:o=30,scanLimit:a}=n??{},i=new I(t),s=k(i.fileDependencyGraph(e));return M({candidates:()=>x(i,e,r),orderCandidates:F,scanLimit:a,prepare:l=>({callerFileMap:D(i,l,{semantic:n?.semantic!==!1}),reverseFanIn:s}),evaluate:(l,c)=>h(t,i,l,c),orderResults:(l,c)=>c.callerFanIn-l.callerFanIn||c.loc-l.loc,limit:o})}function h(t,n,e,r){let o=S(t,n,e,r.callerFileMap);if(o.length!==1)return null;let a=o[0],i=y(t,e.symbolId,a);if(!i)return null;let s=v(n,t,a,e.symbol,i);if(s&&p(s.symbol))return null;let{fanIn:l,source:c}=P(r.callerFileMap,r.reverseFanIn,a,s);return(c==="function"?l<=3:l<=5)?null:{symbol:e.symbol,shortName:m(e.symbol),file:e.relativePath,startLine:e.startLine,endLine:e.endLine,loc:C(e),singleCaller:s?.symbol??"",singleCallerShort:s?.isFunctionLike?m(s.symbol):u(a),callerFanIn:l}}function x(t,n,e){return t.productionCallableDefinitions({scope:n,minLoc:2,maxLoc:e,requireFunctionLikeSymbol:!0,excludeRootedSymbols:!0})}function S(t,n,e,r){let o=u(e.relativePath,f(e.relativePath)),a=[...r.get(e.symbolId)??[]].filter(i=>i!==e.relativePath).filter(i=>u(i,f(i))!==o).filter(i=>{let s=n.fileKind(i);return s!=="barrel"&&s!=="entry"&&s!=="test"});return L(t,e,a).realConsumers}function y(t,n,e){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`,n,e)}function v(t,n,e,r,o){let a=t.definitionsForFile(e),i=_(n,e,r,o.start_line,o.end_line);return g(a,i)}function P(t,n,e,r){if(r?.isFunctionLike){let o=[...t.get(r.symbolId)??[]].filter(a=>a!==r.relativePath);if(o.length>0)return{fanIn:o.length,source:"function"}}return{fanIn:N(n,e),source:"file"}}function _(t,n,e,r,o){let a=d(e);if(!a)return r;let i=b(t,n).get(a);if(!i||i.length===0)return r;for(let s of i)if(s>=r&&s<=o)return s;return r}function k(t){let n=new Map;for(let[e,r]of t){n.has(e)||n.set(e,n.get(e)??0);for(let o of r)n.set(o,(n.get(o)??0)+1)}return n}function N(t,n){let e=t.get(n)??0;if(e>0)return e;let r=u(n,f(n)),o=0;for(let[a,i]of t)a!==n&&u(a,f(a))===r&&i>o&&(o=i);return o}export{q as a};
|
|
7
|
-
//# sourceMappingURL=chunk-WN5Z3UVT.js.map
|
package/dist/chunk-XCW7DYHM.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as f,c as y}from"./chunk-MX6F756F.js";import{g as L}from"./chunk-ZF6P2NAT.js";import{x as d}from"./chunk-WEJYUS5O.js";import{c as b,o as h,p as S,s as x}from"./chunk-O6KCZPJQ.js";import{a as g}from"./chunk-OH5HIAID.js";function F(n,e={}){let{scope:s,minLoc:t=1,limit:i,scanLimit:a}=e,o=e.semantic!==!1,l=M(n,$(n,{scope:s,minLoc:t,scanLimit:a}),{semantic:o}),r=I(l);return i?r.slice(0,i):r}function $(n,e){let s=x(n,{scope:e.scope}).filter(t=>t.isFunctionLike&&!n.isIgnored(t.relativePath)).filter(t=>f(t)>=e.minLoc);return typeof e.scanLimit=="number"&&e.scanLimit>0&&s.sort((t,i)=>f(i)-f(t)||t.relativePath.localeCompare(i.relativePath)),y(s,e.scanLimit)}function M(n,e,s){let t=new Map;for(let i of e){let a=w(n,i,s);if(!a)continue;let o=t.get(a)??[];o.push(v(i)),t.set(a,o)}return t}function v(n){return{symbol:n.symbol,shortName:b(n.symbol),file:n.relativePath,startLine:n.startLine,endLine:n.endLine,loc:f(n)}}function I(n){let e=[];for(let[s,t]of n)t.length>=2&&e.push({signature:s,functions:t});return e.sort((s,t)=>{let i=t.functions.length-s.functions.length;if(i!==0)return i;let a=s.functions.reduce((l,r)=>l+r.loc,0);return t.functions.reduce((l,r)=>l+r.loc,0)-a}),e}function w(n,e,s){if(s.semantic){let a=L(n,e);if(a)return a}let t=G(e.documentation),i=t?A(t):null;return i||R(P(n,e.relativePath,e.startLine,e.endLine,e.leaf),e.leaf)}function G(n){return h(S(n))}function P(n,e,s,t,i){let a=g(n,e);if(!a)return null;let o=a.split(/\r?\n/),l=E(o,s,t,i);for(let r of l){let p=Math.min(o.length-1,Math.max(r,r+4)),u="";for(let c=r;c<=p;c+=1){let m=o[c]?.trim();if(m&&(u=u?`${u} ${m}`:m,z(u)))return u}if(u&&u.includes("("))return u}return null}function z(n){let e=n.replace(/\s+/g," ").trim();return!e.includes("(")||d(e)>0?!1:/[;{]$/.test(e)||/\)\s*(?::\s*[^={]+)?\s*(?:=>|=|throws\b|where\b|$)/i.test(e)||/\)\s*As\s+.+$/i.test(e)}function A(n){if(!n||!n.trim())return null;let e=n.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(),s=e.indexOf("(");return s===-1||(e=e.slice(s),e=e.replace(/\s+/g,"").toLowerCase(),e.length<3)?null:e}function R(n,e){if(!n||!n.trim())return null;let s=n.replace(/\s+/g," ").trim(),t=s.indexOf("(");if(t===-1)return null;let i=s.slice(0,t),o=new RegExp(`\\b${D(e)}\\b`,"i").exec(i);o&&typeof o.index=="number"&&(i=i.slice(0,o.index)),i=i.replace(/\b(public|private|protected|internal|final|static|abstract|sealed|virtual|override|async|suspend|inline|constexpr|consteval|constinit|const|pub|fn|function|def|sub|friend|shared|readonly|new|open|partial|export)\b/gi," ").replace(/\s+/g," ").trim();let l=C(s.slice(t)).replace(/\)\s*=\s*[\s\S]*$/,")").replace(/\s+throws\s+[^={]+$/i,"").replace(/\s+where\s+.+$/i,"").replace(/\s+/g," ").trim();if(!l.startsWith("("))return null;let r=`${i?`${i} `:""}${l}`.replace(/\s+/g,"").toLowerCase();return r.length>=3?r:null}function C(n){let e=0,s=0,t=0,i=0,a=null,o=!1;for(let l=0;l<n.length;l+=1){let r=n[l];if(a){if(o){o=!1;continue}if(r==="\\"){o=!0;continue}r===a&&(a=null);continue}if(r==='"'||r==="'"||r==="`"){a=r;continue}if(r==="(")e+=1;else if(r===")")e=Math.max(0,e-1);else if(r==="[")t+=1;else if(r==="]")t=Math.max(0,t-1);else if(r==="<")i+=1;else if(r===">")i=Math.max(0,i-1);else if(r==="{"){if(e===0&&t===0&&i===0)return n.slice(0,l);s+=1}else if(r==="}")s=Math.max(0,s-1);else if(r==="="&&n[l+1]===">"&&e===0&&s===0&&t===0&&i===0)return n.slice(0,l)}return n}function E(n,e,s,t){let i=D(t),a=new RegExp(`\\b${i}\\b\\s*\\(`,"i"),o=new RegExp(`\\bdef\\s+${i}\\b`,"i"),l=[],r=new Set,p=Math.max(0,Math.min(e,n.length-1)),u=Math.max(p,Math.min(n.length-1,Math.max(s,e+4)));for(let c=p;c<=u;c+=1){let m=n[c]??"";(a.test(m)||o.test(m))&&!r.has(c)&&(r.add(c),l.push(c))}for(let c=0;c<n.length;c+=1){let m=n[c]??"";(a.test(m)||o.test(m))&&!r.has(c)&&(r.add(c),l.push(c))}return l}function D(n){return n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}export{F as a};
|
|
2
|
-
//# sourceMappingURL=chunk-XCW7DYHM.js.map
|
package/dist/chunk-ZF6P2NAT.js
DELETED
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import{l as T}from"./chunk-WEJYUS5O.js";import{d as N,r as k}from"./chunk-O6KCZPJQ.js";import{a as x}from"./chunk-NN3O7TPH.js";import{a as _}from"./chunk-VDZL45XI.js";function p(i,e,t){if(i.has(e))return i.get(e);let n=t();return i.set(e,n),n}import U from"path";function se(i,e){return i.getReferences().map(t=>{let n=t.getNode();return B(n,e)})}function ae(i){let e=i;return typeof e.findReferences=="function"?e.findReferences():[]}function W(i,e,t,n){let r=[];for(let o of ae(i))for(let s of se(o,n))s.file===e.relativePath&&s.line>=e.startLine&&s.line<=e.endLine||r.push(s);for(let o of t)r.push(o);return E(r)}function $(i,e,t,n){let r=[],o=t?.getStart();for(let s of i.getReferences()){let a=s.getNode();y(n,a.getSourceFile().getFilePath())===e&&(o!==void 0&&a.getStart()===o||r.push({location:B(a,n),node:a}))}return r}function B(i,e){let t=i.getSourceFile(),n=t.getLineAndColumnAtPos(i.getStart());return{file:y(e,t.getFilePath())??t.getBaseName(),line:n.line-1,column:n.column-1}}function H(i,e,t){let n=i.getSourceFile(),r=g(n,i),o=i.getText(),s=new RegExp(`\\b${ce(o)}\\b`,"g"),a=n.getFullText().split(`
|
|
2
|
-
`),l=[];for(let c=0;c<a.length;c++){if(c===r)continue;let f=a[c]??"";s.lastIndex=0;let u;for(;(u=s.exec(f))!==null;)l.push({file:e,line:c,column:u.index})}return E(l.filter(c=>y(t,U.join(t,c.file))===e))}function P(i){for(let e=i;e;e=e.getParent()){let t=e.getKindName();if(t.includes("Type")||t==="InterfaceDeclaration"||t==="TypeAliasDeclaration")return!0;if(t==="CallExpression"||t==="NewExpression"||t==="ExpressionStatement")return!1}return!1}function g(i,e){return i.getLineAndColumnAtPos(e.getStart()).line-1}function E(i){let e=new Set,t=[];for(let n of i){let r=`${n.file}:${n.line}:${n.column}`;e.has(r)||(e.add(r),t.push(n))}return t}function y(i,e){let t=U.relative(i||process.cwd(),e).replace(/\\/g,"/");return!t||t.startsWith("..")?null:t}function ce(i){return i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function J(i,e,t,n){let r=le(e,n);return r.size===0?new Map:de(i,t,r)}function le(i,e){let t=new Map;for(let n of k(i,e)){let r=N(n.symbol)??n.leaf;if(!r)continue;let o=t.get(r);o||(o=[],t.set(r,o)),o.push(n)}return t}function de(i,e,t){let n=new Map,r=new Map;return e.forEachDescendant(o=>{for(let s of pe(i,o)){let a=t.get(s);if(!a)continue;let l=g(e,o);for(let c of a){if(l<c.startLine-1||l>c.endLine+1)continue;let f=Math.abs(l-c.startLine),u=r.get(c.symbolId);u!==void 0&&u<=f||(r.set(c.symbolId,f),n.set(c.symbolId,o))}}}),n}function pe(i,e){let t=[],n=r=>{r&&!t.includes(r)&&t.push(r)};if("getNameNode"in e&&typeof e.getNameNode=="function"){let r=e.getNameNode();n(r?.getText())}if("getName"in e&&typeof e.getName=="function"){let r=e.getName();n(r)}return i.Node.isIdentifier(e)&&n(e.getText()),t}function V(i,e,t,n){return i.all(`SELECT
|
|
3
|
-
gs.id AS symbolId,
|
|
4
|
-
gs.symbol,
|
|
5
|
-
d.relative_path AS relativePath,
|
|
6
|
-
COALESCE(der.start_line, c.start_line) AS startLine,
|
|
7
|
-
COALESCE(der.end_line, c.end_line) AS endLine,
|
|
8
|
-
COALESCE(gs.display_name, '') AS leaf,
|
|
9
|
-
NULL AS parentTypeName,
|
|
10
|
-
CASE WHEN gs.kind IN (6, 12, 13) OR gs.symbol LIKE '%().' THEN 1 ELSE 0 END AS isFunctionLike,
|
|
11
|
-
CASE WHEN gs.kind IN (5, 8, 11) THEN 1 ELSE 0 END AS isTypeLike,
|
|
12
|
-
gs.kind AS kind,
|
|
13
|
-
gs.documentation AS documentation,
|
|
14
|
-
gs.enclosing_symbol AS enclosingSymbol
|
|
15
|
-
FROM global_symbols gs
|
|
16
|
-
LEFT JOIN defn_enclosing_ranges der ON der.symbol_id = gs.id
|
|
17
|
-
LEFT JOIN chunks c ON c.document_id = der.document_id
|
|
18
|
-
JOIN documents d ON d.id = der.document_id
|
|
19
|
-
WHERE d.relative_path = ?
|
|
20
|
-
AND COALESCE(gs.display_name, gs.symbol) LIKE ?
|
|
21
|
-
ORDER BY ABS(COALESCE(der.start_line, c.start_line) - ?)
|
|
22
|
-
LIMIT 5`,e,`%${n}%`,t)[0]??null}function K(i,e){let t=i.all(`SELECT
|
|
23
|
-
d.id AS documentId,
|
|
24
|
-
gs.id AS symbolId,
|
|
25
|
-
gs.symbol,
|
|
26
|
-
d.relative_path AS relativePath,
|
|
27
|
-
der.start_line AS startLine,
|
|
28
|
-
der.end_line AS endLine,
|
|
29
|
-
COALESCE(gs.display_name, '') AS leaf,
|
|
30
|
-
NULL AS parentTypeName,
|
|
31
|
-
CASE WHEN gs.kind IN (6, 12, 13) OR gs.symbol LIKE '%().' THEN 1 ELSE 0 END AS isFunctionLike,
|
|
32
|
-
CASE WHEN gs.kind IN (5, 8, 11) THEN 1 ELSE 0 END AS isTypeLike,
|
|
33
|
-
gs.kind AS kind,
|
|
34
|
-
gs.documentation AS documentation,
|
|
35
|
-
gs.enclosing_symbol AS enclosingSymbol
|
|
36
|
-
FROM global_symbols gs
|
|
37
|
-
JOIN defn_enclosing_ranges der ON der.symbol_id = gs.id
|
|
38
|
-
JOIN documents d ON d.id = der.document_id
|
|
39
|
-
WHERE d.relative_path = ?
|
|
40
|
-
UNION ALL
|
|
41
|
-
SELECT
|
|
42
|
-
d.id AS documentId,
|
|
43
|
-
gs.id AS symbolId,
|
|
44
|
-
gs.symbol,
|
|
45
|
-
d.relative_path AS relativePath,
|
|
46
|
-
MIN(c.start_line) AS startLine,
|
|
47
|
-
MAX(c.end_line) AS endLine,
|
|
48
|
-
COALESCE(gs.display_name, '') AS leaf,
|
|
49
|
-
NULL AS parentTypeName,
|
|
50
|
-
CASE WHEN gs.kind IN (6, 12, 13) OR gs.symbol LIKE '%().' THEN 1 ELSE 0 END AS isFunctionLike,
|
|
51
|
-
CASE WHEN gs.kind IN (5, 8, 11) THEN 1 ELSE 0 END AS isTypeLike,
|
|
52
|
-
gs.kind AS kind,
|
|
53
|
-
gs.documentation AS documentation,
|
|
54
|
-
gs.enclosing_symbol AS enclosingSymbol
|
|
55
|
-
FROM global_symbols gs
|
|
56
|
-
JOIN mentions m ON m.symbol_id = gs.id
|
|
57
|
-
JOIN chunks c ON c.id = m.chunk_id
|
|
58
|
-
JOIN documents d ON d.id = c.document_id
|
|
59
|
-
WHERE d.relative_path = ?
|
|
60
|
-
AND m.role = 1
|
|
61
|
-
GROUP BY gs.id, gs.symbol, d.id, d.relative_path, gs.display_name, gs.kind, gs.documentation, gs.enclosing_symbol
|
|
62
|
-
ORDER BY startLine, endLine`,e,e),n=new Set,r=new Map;for(let o of t){if(n.has(o.symbolId))continue;n.add(o.symbolId);let s=o.leaf||N(o.symbol);!s||r.has(s)||r.set(s,{...o,leaf:s})}return r}import fe from"path";var S=[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs"];function D(i){let e=i.toLowerCase();return S.some(t=>e.endsWith(t))}function z(i,e){let t=new Map,n=r=>D(r)?p(t,r,()=>{let o=fe.join(i.config.projectRoot,r);for(let{project:s}of e){let a=s.getSourceFile(o)??s.addSourceFileAtPathIfExists(o)??null;if(a)return{project:s,sourceFile:a}}return null}):null;return{sourceFile:r=>n(r)?.sourceFile??null,sourceFileMatch:n,indexedTypeScriptLikeDocuments:()=>x(i,{extensions:S})}}import m from"path";import{existsSync as M,readdirSync as ue,readFileSync as Y}from"fs";function X(i){let e=m.join(i,"package.json");if(!M(e))return[];let t;try{t=JSON.parse(Y(e,"utf8"))}catch{return[]}return(Array.isArray(t.workspaces)?t.workspaces:t.workspaces?.packages??[]).flatMap(r=>me(i,r)).flatMap(r=>ge(i,r))}function me(i,e){if(!e||e.startsWith("!")||e.includes("node_modules"))return[];if(!e.includes("*")){let s=m.join(i,e);return M(m.join(s,"package.json"))?[s]:[]}let t=e.indexOf("*"),n=e.slice(0,t).replace(/\/$/,""),r=e.slice(t+1).replace(/^\//,""),o=m.join(i,n||".");if(!M(o))return[];try{return ue(o).map(s=>m.join(o,s,r)).filter(s=>M(m.join(s,"package.json")))}catch{return[]}}function ge(i,e){try{let t=JSON.parse(Y(m.join(e,"package.json"),"utf8"));if(!t.name)return[];let n=m.relative(i,e).replace(/\\/g,"/");return[{name:t.name,rootRelative:n,sourceRootRelative:`${n}/src`}]}catch{return[]}}function q(i,e){for(let t of i)if(e===t.name||e.startsWith(`${t.name}/`))return t.name;return null}function G(i){return[`${i.sourceRootRelative}/index.ts`,`${i.sourceRootRelative}/index.tsx`,`${i.sourceRootRelative}/index.mts`,`${i.sourceRootRelative}/index.cts`]}import{existsSync as h,readFileSync as ye,readdirSync as Se,statSync as he}from"fs";import d from"path";var R=["tsconfig.json","tsconfig.app.json","tsconfig.node.json","tsconfig.base.json"];function C(i,e){let n=e?d.dirname(d.join(i,e)):i,r=d.resolve(i);for(;n.startsWith(r);){for(let s of R){let a=d.join(n,s);if(h(a))return a}let o=d.dirname(n);if(o===n)break;n=o}for(let o of R){let s=d.join(i,o);if(h(s))return s}return null}function Q(i){let e=i.config.projectRoot,t=new Set(Ie(e,i.config.semantic?.typescript?.tsconfigs)),n=x(i,{includeIgnored:!1,extensions:S});for(let r of n){let o=C(e,r);o&&t.add(d.resolve(o))}if(t.size===0){let r=C(e);r&&t.add(d.resolve(r))}return[...t].filter(r=>!Z(e,r)).sort((r,o)=>r.localeCompare(o))}function Ie(i,e=[]){let t=new Set;for(let n of e){let r=d.isAbsolute(n)?n:d.join(i,n);h(r)&&t.add(d.resolve(r))}for(let n of be(i))for(let r of R){let o=d.join(n,r);h(o)&&t.add(d.resolve(o))}if(t.size===0){let n=C(i);n&&t.add(d.resolve(n))}return[...t].filter(n=>!Z(i,n)).sort((n,r)=>n.localeCompare(r))}function be(i){let e=d.join(i,"package.json");if(!h(e))return[];let t;try{t=JSON.parse(ye(e,"utf8"))}catch{return[]}return(Array.isArray(t.workspaces)?t.workspaces:t.workspaces?.packages??[]).flatMap(r=>xe(i,r))}function xe(i,e){if(!e||e.startsWith("!")||e.includes("node_modules"))return[];if(!e.includes("*")){let s=d.join(i,e);return L(s)?[s]:[]}let t=e.indexOf("*"),n=e.slice(0,t).replace(/\/$/,""),r=e.slice(t+1).replace(/^\//,""),o=d.join(i,n||".");return L(o)?Se(o).map(s=>d.join(o,s,r)).filter(L):[]}function L(i){try{return he(i).isDirectory()}catch{return!1}}function Z(i,e){let t=d.relative(i,e).replace(/\\/g,"/");return t.startsWith("..")||t.includes("/node_modules/")||t.startsWith("node_modules/")||t.includes("/dist/")||t.startsWith("dist/")}import{createRequire as Ne}from"module";var ke=Ne(import.meta.url),I;function ee(){if(I!==void 0)return I;try{I=ke("ts-morph")}catch{I=null}return I}function te(i,e){return e.map(t=>({tsconfigPath:t,project:new i.Project({tsConfigFilePath:t,skipFileDependencyResolution:!1})}))}function F(i,e,t){return{language:"typescript",availability:()=>({available:!1,reason:i,tsconfigPath:e,tsconfigPaths:t}),importUsage:()=>[],referencesFor:()=>[],calleesFor:()=>[],signatureFor:()=>null}}function re(i,e){let t=ee();if(!t)return F("ts-morph is not installed");let n=Q(i);if(n.length===0)return F("no tsconfig found");try{let r=te(t,n);return new A(i,t,r)}catch(r){return F(r instanceof Error?r.message:String(r),n[0],n)}}var A=class{constructor(e,t,n){this.db=e;this.tsMorph=t;this.projects=n;this.workspacePackages=X(e.config.projectRoot),this.sourceFiles=z(e,n)}db;tsMorph;projects;language="typescript";importUsageCache=new Map;referencesCache=new Map;calleesCache=new Map;fileCalleesCache=new Map;signatureCache=new Map;definitionNodeCache=new Map;fileDefinitionNodeCache=new Map;indexedDefinitionLeafCache=new Map;packageImportReferenceIndex=null;packageExportIndex=null;workspacePackages;sourceFiles;availability(){return{available:!0,tsconfigPath:this.projects[0]?.tsconfigPath,tsconfigPaths:this.projects.map(e=>e.tsconfigPath)}}importUsage(e){return p(this.importUsageCache,e,()=>{let t=this.sourceFiles.sourceFile(e);if(!t)return[];let n=[];for(let r of t.getImportDeclarations())for(let o of this.importUsageForDeclaration(e,r))n.push(o);return n})}referencesFor(e){return p(this.referencesCache,e.symbolId,()=>{let t=this.nodeForDefinition(e),n=this.packageImportReferencesForDefinition(e);return t?W(t,e,n,this.db.config.projectRoot):n})}calleesFor(e){return p(this.calleesCache,e.symbolId,()=>p(this.fileCalleesCache,e.relativePath,()=>this.calleeMapForFile(e.relativePath)).get(e.symbolId)??[])}signatureFor(e){return p(this.signatureCache,e.symbolId,()=>{let t=this.nodeForDefinition(e);if(!t||!this.tsMorph.Node.isFunctionDeclaration(t)&&!this.tsMorph.Node.isMethodDeclaration(t)&&!this.tsMorph.Node.isArrowFunction(t)&&!this.tsMorph.Node.isFunctionExpression(t)&&!this.tsMorph.Node.isConstructorDeclaration(t))return null;let n=t.getType().getCallSignatures()[0];if(!n)return null;let r=n.getParameters().map(s=>{let a=s.getDeclarations()[0],l=a?s.getTypeAtLocation(a).getText(a):s.getValueDeclaration()?.getType().getText()??"unknown";return ie(l)}),o=n.getReturnType().getText(t);return`(${r.join(",")})=>${ie(o)}`})}importUsageForDeclaration(e,t){let n=T(this.db,e,t.getModuleSpecifierValue()),r=ne(t);return t.getImportClause()?.isTypeOnly()?r.map(o=>Ee(e,n,o)):r.map(o=>this.valueImportUsageForEntry(e,n,o))}valueImportUsageForEntry(e,t,n){let r=n.identifier?n.identifier.findReferences():[],o=[];for(let c of r)for(let f of $(c,e,n.identifier,this.db.config.projectRoot))o.push(f);let s=o.some(c=>!P(c.node)),a=o.some(c=>P(c.node)),l=n.isTypeOnly;return{importer:e,sourcePath:t,importedName:n.importedName,localName:n.localName,kind:n.kind,isTypeOnly:l,isUsed:l||o.length>0,isTypeUsed:l||a,isValueUsed:s,references:o.map(c=>c.location)}}packageImportReferencesForDefinition(e){return this.packageImportReferences().get(e.symbolId)??[]}packageImportReferences(){if(this.packageImportReferenceIndex)return this.packageImportReferenceIndex;let e=new Map,t=this.packageExports();for(let n of this.sourceFiles.indexedTypeScriptLikeDocuments())this.addPackageImportReferencesForDocument(e,t,n);for(let[n,r]of e)e.set(n,E(r));return this.packageImportReferenceIndex=e,e}addPackageImportReferencesForDocument(e,t,n){if(this.db.isIgnored(n))return;let r=this.sourceFiles.sourceFileMatch(n);if(r)for(let o of r.sourceFile.getImportDeclarations())this.addPackageImportReferencesForDeclaration(e,t,n,o)}addPackageImportReferencesForDeclaration(e,t,n,r){let o=q(this.workspacePackages,r.getModuleSpecifierValue());if(!o)return;let s=t.get(o);if(s)for(let a of ne(r)){if(a.kind!=="named"||!a.identifier)continue;let l=s.get(a.importedName);if(!l||l.size===0)continue;let c=H(a.identifier,n,this.db.config.projectRoot);c.length>0&&Fe(e,l,c)}}packageExports(){if(this.packageExportIndex)return this.packageExportIndex;let e=new Map;for(let t of this.workspacePackages){let n=new Map;for(let r of G(t))this.collectPackageExports(t,r,n,new Set);n.size>0&&e.set(t.name,n)}return this.packageExportIndex=e,e}collectPackageExports(e,t,n,r){if(r.has(t))return;r.add(t);let o=this.sourceFiles.sourceFile(t);if(o)for(let s of o.getExportDeclarations()){let a=s.getModuleSpecifierValue(),l=a?T(this.db,t,a):t;if(!l||!l.startsWith(`${e.sourceRootRelative}/`))continue;let c=s.getNamedExports();if(c.length===0){if(s.isNamespaceExport())continue;this.collectPackageExports(e,l,n,r);continue}for(let f of c){let u=f.getNameNode().getText(),w=f.getAliasNode()?.getText()??u,O=this.indexedDefinitionByLeaf(l,u);if(!O)continue;let b=n.get(w);b||(b=new Set,n.set(w,b)),b.add(O.symbolId)}}}indexedDefinitionByLeaf(e,t){return p(this.indexedDefinitionLeafCache,e,()=>K(this.db,e)).get(t)??null}nodeForDefinition(e){return p(this.definitionNodeCache,e.symbolId,()=>this.definitionNodesForFile(e.relativePath).get(e.symbolId)??null)}definitionNodesForFile(e){return p(this.fileDefinitionNodeCache,e,()=>{let t=this.sourceFiles.sourceFile(e);return t?J(this.tsMorph,this.db,t,e):new Map})}definitionFromSymbol(e){let t=e.getDeclarations();for(let n of t){let r=n.getSourceFile(),o=y(this.db.config.projectRoot,r.getFilePath());if(!o||this.db.isIgnored(o))continue;let s=g(r,n),a=V(this.db,o,s,e.getName());if(a)return{symbol:a.symbol,file:a.relativePath,line:a.startLine}}return null}calleeMapForFile(e){let t=this.sourceFiles.sourceFile(e);if(!t)return new Map;let n=k(this.db,e).sort((o,s)=>o.startLine-s.startLine||s.endLine-o.endLine);if(n.length===0)return new Map;let r=new Map;t.forEachDescendant(o=>{if(!this.tsMorph.Node.isCallExpression(o)&&!this.tsMorph.Node.isNewExpression(o))return;let s=this.semanticCalleeForCallNode(t,n,o);s&&De(r,s.callerId,s.target)});for(let[o,s]of r)r.set(o,ve(s));return r}semanticCalleeForCallNode(e,t,n){let r=Me(t,g(e,n));if(!r)return null;let o=n.getExpression(),s=o.getSymbol()??o.getType().getSymbol(),a=s?this.definitionFromSymbol(s):null;return a?{callerId:r.symbolId,target:{symbol:a.symbol,file:a.file,line:a.line}}:null}};function ne(i){let e=[],t=i.getDefaultImport();t&&e.push({identifier:t,importedName:"default",localName:t.getText(),kind:"default",isTypeOnly:i.getImportClause()?.isTypeOnly()??!1});let n=i.getNamespaceImport();n&&e.push({identifier:n,importedName:"*",localName:n.getText(),kind:"namespace",isTypeOnly:i.getImportClause()?.isTypeOnly()??!1});for(let r of i.getNamedImports()){let o=r.getNameNode(),a=r.getAliasNode()??(o.getKindName()==="Identifier"?o:null);e.push({identifier:a,importedName:o.getText(),localName:a?.getText()??o.getText(),kind:"named",isTypeOnly:r.isTypeOnly()||(i.getImportClause()?.isTypeOnly()??!1)})}return e.length===0&&e.push({identifier:null,importedName:"*",localName:null,kind:"side-effect",isTypeOnly:!1}),e}function Ee(i,e,t){return{importer:i,sourcePath:e,importedName:t.importedName,localName:t.localName,kind:t.kind,isTypeOnly:!0,isUsed:!0,isTypeUsed:!0,isValueUsed:!1,references:[]}}function De(i,e,t){let n=i.get(e);n||(n=[],i.set(e,n)),n.push(t)}function Me(i,e){let t=null;for(let n of i)e<n.startLine||e>n.endLine||(!t||n.startLine>=t.startLine)&&(t=n);return t}function Fe(i,e,t){for(let n of e){let r=i.get(n)??[];r.push(...t),i.set(n,r)}}function ve(i){let e=new Set,t=[];for(let n of i){let r=`${n.symbol}|${n.file}|${n.line}`;e.has(r)||(e.add(r),t.push(n))}return t}function ie(i){return i.replace(/\s+/g," ").replace(/\bimport\("[^"]+"\)\./g,"").trim()}var j=new WeakMap;_({name:"semantic-provider",groups:["semantic-provider"],clearAll:i=>j.delete(i)});function oe(i,e){let t=`${i.config.projectRoot}:typescript-workspace`,n=j.get(i);n||(n=new Map,j.set(i,n));let r=n.get(t);if(r)return r;let o=re(i,e);return n.set(t,o),o}function St(i,e){let t=v(i,e);return t?t.importUsage(e):[]}function Te(i,e){let t=v(i,e.relativePath);return t?t.referencesFor(e):[]}function ht(i,e){let t=new Map;for(let n of e)for(let r of Te(i,n)){if(r.file===n.relativePath||i.isIgnored(r.file))continue;let o=t.get(n.symbolId);o||(o=new Set,t.set(n.symbolId,o)),o.add(r.file)}return t}function It(i,e){let t=new Map;for(let n of e){let r=v(i,n.relativePath);if(!r)continue;let o=r.calleesFor(n);o.length>0&&t.set(n.symbolId,o)}return t}function bt(i,e){let t=v(i,e.relativePath);return t?t.signatureFor(e):null}function v(i,e){if(!D(e))return null;let t=oe(i,e);return t.availability().available?t:null}export{D as a,oe as b,St as c,Te as d,ht as e,It as f,bt as g};
|
|
63
|
-
//# sourceMappingURL=chunk-ZF6P2NAT.js.map
|