scip-query 0.7.1 → 0.8.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 +171 -1132
- package/dist/augment-vue-worker.js +1 -1
- package/dist/{chunk-NSTZMBAB.js → chunk-2EC4JTHC.js} +2 -2
- package/dist/{chunk-ZXFTC5ET.js → chunk-46ILZVMX.js} +2 -2
- package/dist/chunk-4A4JFNWG.js +2 -0
- package/dist/{chunk-GAQGJ52J.js → chunk-4B7YLRXX.js} +2 -2
- package/dist/chunk-64UY7VTR.js +63 -0
- package/dist/chunk-66ORT3LS.js +2 -0
- package/dist/{chunk-QPRIYXH4.js → chunk-6G76D2YM.js} +2 -2
- package/dist/{chunk-VUBQBW7H.js → chunk-6P5W4U6G.js} +2 -2
- package/dist/chunk-6ZFKI5EP.js +40 -0
- package/dist/{chunk-ZNUPGRPR.js → chunk-7I6KNKE3.js} +2 -2
- package/dist/{chunk-23YIGCYF.js → chunk-7TYJD45F.js} +5 -5
- package/dist/chunk-7UZWNW4E.js +2 -0
- package/dist/{chunk-4STLJYHI.js → chunk-AGW2MVIO.js} +2 -2
- package/dist/chunk-APLCSDXL.js +4 -0
- package/dist/chunk-BCFED24F.js +2 -0
- package/dist/chunk-CVRXOP6M.js +3 -0
- package/dist/chunk-D43L5PQF.js +2 -0
- package/dist/chunk-DJTJ3DLZ.js +7 -0
- package/dist/chunk-EAU4RDFG.js +2 -0
- package/dist/{chunk-BI4F6GXI.js → chunk-EKP7XJ6L.js} +2 -2
- package/dist/{chunk-33SSUPCB.js → chunk-EM2PPDN7.js} +2 -2
- package/dist/{chunk-ROOHENEP.js → chunk-FIPE5AQT.js} +2 -2
- package/dist/chunk-FTBT4RP2.js +7 -0
- package/dist/{chunk-WPLKHAH7.js → chunk-GD7XRHSV.js} +2 -2
- package/dist/{chunk-WJQY2LGT.js → chunk-GMEBYEMU.js} +2 -2
- package/dist/chunk-GTZAU7OL.js +2 -0
- package/dist/chunk-HVGNOUYP.js +2 -0
- package/dist/chunk-HVXIXDLV.js +2 -0
- package/dist/{chunk-KJ3ZJIE5.js → chunk-I7OTKWNY.js} +2 -2
- package/dist/{chunk-2JEFS2YJ.js → chunk-JAMU6FLN.js} +2 -2
- package/dist/chunk-JTCEWV7Q.js +2 -0
- package/dist/chunk-K4Z3FCUJ.js +6 -0
- package/dist/{chunk-FD37DBTD.js → chunk-K6YIGVL7.js} +2 -2
- package/dist/chunk-MKE7SEEX.js +2 -0
- package/dist/chunk-N5D5ZCBW.js +7 -0
- package/dist/{chunk-ROZNBWIF.js → chunk-NGLRXEWN.js} +2 -2
- package/dist/{chunk-J6Z5YKGQ.js → chunk-NK7TQQG4.js} +2 -2
- package/dist/chunk-NOVKLH2F.js +2 -0
- package/dist/chunk-OIMM7KMI.js +2 -0
- package/dist/chunk-OQSV6OS2.js +2 -0
- package/dist/chunk-PBGTMPJ7.js +2 -0
- package/dist/{chunk-ARBZM2NF.js → chunk-PCMVXWDC.js} +4 -4
- package/dist/{chunk-U75WH4XG.js → chunk-PE4EJOLN.js} +2 -2
- package/dist/chunk-PLFYFZX3.js +2 -0
- package/dist/{chunk-A2AVLALL.js → chunk-QYQXPPDI.js} +2 -2
- package/dist/{chunk-3OUC276S.js → chunk-RCRK4E7E.js} +2 -2
- package/dist/chunk-RIXOMSOR.js +20 -0
- package/dist/chunk-SB6I6O3P.js +2 -0
- package/dist/{chunk-KNA6Z7JB.js → chunk-SDGCKEB7.js} +2 -2
- package/dist/chunk-SLOIQKY7.js +2 -0
- package/dist/chunk-SOGLYIJ4.js +62 -0
- package/dist/chunk-SSINY7HL.js +4 -0
- package/dist/{chunk-563HLCDW.js → chunk-TFO4OMJZ.js} +2 -2
- package/dist/chunk-TH4JVC34.js +71 -0
- package/dist/chunk-TQTVM27C.js +6 -0
- package/dist/{chunk-LDV2B7ET.js → chunk-TR5AU6A5.js} +2 -2
- package/dist/{chunk-WODJHE6Z.js → chunk-UQE3DSXY.js} +2 -2
- package/dist/{chunk-72JOIFXL.js → chunk-UUDYI3FF.js} +2 -2
- package/dist/chunk-VDZL45XI.js +2 -0
- package/dist/{chunk-QWJBIBE6.js → chunk-VN6B6HFB.js} +2 -2
- package/dist/{chunk-DFK54IRN.js → chunk-WC43FMAB.js} +2 -2
- package/dist/chunk-WEJYUS5O.js +2 -0
- package/dist/chunk-WQFOZIID.js +4 -0
- package/dist/chunk-XBFLIGWU.js +3 -0
- package/dist/chunk-XSZ5NC4O.js +2 -0
- package/dist/{chunk-2IYEIFPP.js → chunk-Z2AJQ7VA.js} +2 -2
- package/dist/chunk-ZIIQ55VK.js +2 -0
- package/dist/chunk-ZJ737ZMD.js +2 -0
- package/dist/cli.js +171 -174
- package/dist/health-C6r2VgpA.d.ts +234 -0
- package/dist/index.d.ts +16 -30
- package/dist/index.js +1 -1
- package/dist/postinstall.js +4 -4
- 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.d.ts +66 -0
- package/dist/queries/cleanup-plan.js +2 -0
- package/dist/queries/co-change.d.ts +42 -0
- package/dist/queries/co-change.js +2 -0
- package/dist/queries/code.js +1 -1
- package/dist/queries/complexity-hotspots.d.ts +1 -1
- package/dist/queries/complexity-hotspots.js +1 -1
- package/dist/queries/complexity.js +1 -1
- package/dist/queries/convergence.js +1 -1
- package/dist/queries/coupling.js +1 -1
- package/dist/queries/cycles.js +1 -1
- package/dist/queries/dataflow.js +1 -1
- package/dist/queries/dead.js +1 -1
- package/dist/queries/deep-chains.js +1 -1
- package/dist/queries/deps.js +1 -1
- package/dist/queries/diff-gate.d.ts +52 -0
- package/dist/queries/diff-gate.js +2 -0
- package/dist/queries/diff-impact.js +1 -1
- package/dist/queries/doc-drift.d.ts +69 -0
- package/dist/queries/doc-drift.js +2 -0
- package/dist/queries/drift.js +1 -1
- package/dist/queries/extract-candidates.js +1 -1
- package/dist/queries/fan.js +1 -1
- package/dist/queries/health.d.ts +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/index.d.ts +38 -2
- package/dist/queries/index.js +1 -1
- package/dist/queries/isolated.js +1 -1
- package/dist/queries/members.js +1 -1
- package/dist/queries/methods.js +1 -1
- package/dist/queries/outline.d.ts +1 -0
- package/dist/queries/outline.js +1 -1
- package/dist/queries/passthrough-candidates.js +1 -1
- package/dist/queries/plan-context.d.ts +65 -0
- package/dist/queries/plan-context.js +2 -0
- package/dist/queries/recent-duplicates.d.ts +48 -0
- package/dist/queries/recent-duplicates.js +2 -0
- package/dist/queries/redundant-reexports.js +1 -1
- package/dist/queries/refs.js +1 -1
- package/dist/queries/self-audit.d.ts +58 -0
- package/dist/queries/self-audit.js +2 -0
- package/dist/queries/similar-chains.js +1 -1
- package/dist/queries/similar-files.d.ts +6 -0
- package/dist/queries/similar-files.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/unused-params.d.ts +38 -0
- package/dist/queries/unused-params.js +2 -0
- package/dist/queries/wrapper-candidates.js +1 -1
- package/dist/reindex-worker.js +1 -1
- package/dist/reindex.js +16 -16
- package/dist/runtime.d.ts +3 -2
- package/dist/runtime.js +2 -2
- package/package.json +34 -1
- package/skills/concrete-plan/SKILL.md +37 -7
- package/skills/scip-ai-cleanup/SKILL.md +145 -0
- package/skills/scip-debloat/SKILL.md +37 -7
- package/skills/scip-explore/SKILL.md +22 -9
- package/skills/scip-language-playbook/SKILL.md +4 -4
- package/skills/scip-maintainability/SKILL.md +264 -0
- package/skills/scip-verify/SKILL.md +2 -2
- package/dist/chunk-3GNFUVFA.js +0 -2
- package/dist/chunk-5TT47UMX.js +0 -44
- package/dist/chunk-6H2XIIPY.js +0 -71
- package/dist/chunk-7H4RJ4MC.js +0 -2
- package/dist/chunk-7O4MJYIW.js +0 -63
- package/dist/chunk-7OX2O53H.js +0 -62
- package/dist/chunk-BOVNTAKQ.js +0 -3
- package/dist/chunk-CKIO6SVS.js +0 -2
- package/dist/chunk-D6Z67MZL.js +0 -2
- package/dist/chunk-FOQQDXE7.js +0 -2
- package/dist/chunk-IODTPF5H.js +0 -20
- package/dist/chunk-JB4PUN5S.js +0 -40
- package/dist/chunk-JTXKS5GK.js +0 -3
- package/dist/chunk-KJ6CW6EK.js +0 -2
- package/dist/chunk-MDAYGS6T.js +0 -2
- package/dist/chunk-NHDPYW7O.js +0 -2
- package/dist/chunk-NKJKI6SE.js +0 -2
- package/dist/chunk-NYEMZHUC.js +0 -6
- package/dist/chunk-OHEIZWIA.js +0 -4
- package/dist/chunk-QAEDNTY7.js +0 -2
- package/dist/chunk-QE6MGGUY.js +0 -2
- package/dist/chunk-RCJEFQOK.js +0 -4
- package/dist/chunk-TGK5DFBJ.js +0 -2
- package/dist/chunk-TRNAQABL.js +0 -7
- package/dist/chunk-V53J46BX.js +0 -2
- package/dist/chunk-XO6R3X5J.js +0 -2
- package/dist/chunk-YSZNAG4G.js +0 -2
- package/dist/health-x7B4Xu_6.d.ts +0 -119
|
@@ -0,0 +1,71 @@
|
|
|
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
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import{a as b}from"./chunk-RIXOMSOR.js";import{c as p}from"./chunk-PBGTMPJ7.js";import{f as g}from"./chunk-WQFOZIID.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-TQTVM27C.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as r}from"./chunk-
|
|
1
|
+
import{a as r}from"./chunk-WC43FMAB.js";import{a as c}from"./chunk-RIXOMSOR.js";import{a as l}from"./chunk-7I6KNKE3.js";import{c as d}from"./chunk-SOGLYIJ4.js";function p(e,t){let o=l(e,t);if(!o)return[];let n=e.get(`SELECT COUNT(DISTINCT c.document_id) AS file_count
|
|
2
2
|
FROM mentions m
|
|
3
3
|
JOIN chunks c ON m.chunk_id = c.id
|
|
4
4
|
WHERE m.symbol_id = ?
|
|
@@ -59,4 +59,4 @@ import{a as r}from"./chunk-DFK54IRN.js";import{a as c}from"./chunk-IODTPF5H.js";
|
|
|
59
59
|
GROUP BY d.id
|
|
60
60
|
ORDER BY symbol_count DESC
|
|
61
61
|
LIMIT ?`,o).filter(i=>!e.isIgnored(i.relative_path)).map(i=>({name:i.relative_path,count:i.symbol_count}))}export{p as a,b,y as c,I as d};
|
|
62
|
-
//# sourceMappingURL=chunk-
|
|
62
|
+
//# sourceMappingURL=chunk-TR5AU6A5.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{b as l}from"./chunk-
|
|
1
|
+
import{b as l}from"./chunk-WC43FMAB.js";import{a}from"./chunk-NOVKLH2F.js";import{c as i,f as n}from"./chunk-SOGLYIJ4.js";function _(e,r){let t=l(e,r);return t.length===0?[]:m([...d(e,t),...c(e,t)]).filter(o=>!e.isIgnored(o.relative_path)).map(u)}function d(e,r){let t=r.map(()=>"?").join(", ");return e.all(`SELECT DISTINCT d1.relative_path, gs.symbol
|
|
2
2
|
FROM mentions m
|
|
3
3
|
JOIN chunks c ON m.chunk_id = c.id
|
|
4
4
|
JOIN documents d1 ON c.document_id = d1.id
|
|
@@ -26,4 +26,4 @@ import{b as l}from"./chunk-DFK54IRN.js";import{b as a}from"./chunk-QAEDNTY7.js";
|
|
|
26
26
|
AND ${e.localSymbolPredicate}
|
|
27
27
|
${e.pathExclusionsFor("d1")}
|
|
28
28
|
ORDER BY d1.relative_path`,...r,...r,...r)}function c(e,r){let t=new a(e);return r.flatMap(o=>t.definitionsForFile(o).filter(s=>n(s.symbol)).map(s=>({relative_path:o,symbol:s.symbol})))}function m(e){let r=new Set;return e.filter(t=>{let o=`${t.relative_path}|${t.symbol}`;return r.has(o)?!1:(r.add(o),!0)})}function u(e){return{consumer:e.relative_path,symbol:e.symbol,shortName:i(e.symbol)}}export{_ as a};
|
|
29
|
-
//# sourceMappingURL=chunk-
|
|
29
|
+
//# sourceMappingURL=chunk-UQE3DSXY.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{a as N}from"./chunk-EAU4RDFG.js";import{a as I,b as S}from"./chunk-7I6KNKE3.js";import{c as h,e as b,r as p,v as g}from"./chunk-SOGLYIJ4.js";function x(o,s,r={}){let{maxDepth:c=5,scope:a}=r,l=I(o,s);if(!l)return[];let u=[],f=new Set([l.symbolId]),m=new Set,t=[l];for(let e=1;e<=c&&t.length!==0;e++){let i=[];for(let y of t)for(let n of D(o,y,a)){let d=`${n.file}|${n.shortName}`;if(n.symbolId!==null){if(f.has(n.symbolId))continue;f.add(n.symbolId)}else if(m.has(d))continue;m.add(d),u.push({symbol:n.symbol,shortName:n.shortName,file:n.file,depth:e}),n.symbolId!==null&&n.symbolMatch&&i.push(n.symbolMatch)}t=i}return u.sort((e,i)=>e.depth-i.depth||e.file.localeCompare(i.file)),u}function D(o,s,r){let c=N(o,s,{limit:500}).filter(t=>!o.isIgnored(t.file)).filter(t=>!r||t.file.includes(r)),a=new Set(c.map(t=>t.file)),l=[];for(let t of M(o,s,r)){if(a.has(t))continue;let e=p(o,t),i=e.length>0?g(e,e[0].startLine):null;l.push({symbol:i?.symbol??t,file:t})}let u=[...c,...l],f=[],m=new Set;for(let t of u){let e=S(o,t.symbol);if(!e){let y=`${t.file}|${t.symbol}`;if(m.has(y))continue;m.add(y),f.push({symbolId:null,symbol:t.symbol,shortName:h(t.symbol),file:t.file,symbolMatch:null});continue}if(e.symbolId===s.symbolId||o.isIgnored(e.relativePath)||!_(e.symbol))continue;let i=`${e.symbolId}|${e.relativePath}`;m.has(i)||(m.add(i),f.push({symbolId:e.symbolId,symbol:e.symbol,shortName:h(e.symbol),file:e.relativePath,symbolMatch:e}))}return f}function M(o,s,r){let c=r?"AND consumer_d.relative_path LIKE ?":"",a=[s.symbolId,s.documentId];return r&&a.push(`%${r}%`),new Set(o.all(`SELECT DISTINCT consumer_d.relative_path
|
|
2
2
|
FROM mentions m
|
|
3
3
|
JOIN chunks c ON m.chunk_id = c.id
|
|
4
4
|
JOIN documents consumer_d ON consumer_d.id = c.document_id
|
|
@@ -7,4 +7,4 @@ import{b as N}from"./chunk-ARBZM2NF.js";import{a as I,b as S}from"./chunk-ZNUPGR
|
|
|
7
7
|
AND c.document_id != ?
|
|
8
8
|
${o.pathExclusionsFor("consumer_d")}
|
|
9
9
|
${c}`,...a).map(l=>l.relative_path).filter(l=>!o.isIgnored(l)))}function _(o){let s=b(o);return s==="method"||s==="type"||o.endsWith("().")}export{x as a};
|
|
10
|
-
//# sourceMappingURL=chunk-
|
|
10
|
+
//# sourceMappingURL=chunk-UUDYI3FF.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
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
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{o as d}from"./chunk-6ZFKI5EP.js";import{a as h}from"./chunk-7I6KNKE3.js";import{g}from"./chunk-SOGLYIJ4.js";import{a as m}from"./chunk-WQFOZIID.js";import{a as p}from"./chunk-NN3O7TPH.js";function _(t,r,n={}){let e=h(t,r);if(!e)return[];let l=!g(e.symbol)&&!t.isIgnored(e.relativePath)?[{relativePath:e.relativePath,line:e.startLine}]:[],c=d(t,e,{semantic:n.semantic}).map(o=>({relativePath:o.file,line:o.line})),s=R(t,e),f=new Set,a=[];for(let o of[...l,...c,...s]){let u=`${o.relativePath}:${o.line}`;f.has(u)||(f.add(u),a.push(o))}return a}function R(t,r){if(!r.relativePath.endsWith(".rb"))return[];let n=b(r.symbol);if(n.length===0)return[];let e=[];for(let i of p(t,{extensions:[".rb"],includeIgnored:!1})){let l=m(t,i);if(!l)continue;let c=l.split(`
|
|
2
2
|
`);for(let s=0;s<c.length;s++){let f=c[s]??"";n.some(a=>new RegExp(`@${a}\\b|\\b${a}:`).test(f))&&e.push({relativePath:i,line:s})}}return e}function b(t){let n=(t.split(":").pop()??t).replace(/([a-z0-9])([A-Z])/g,"$1_$2").replace(/[^A-Za-z0-9_]+/g,"_").toLowerCase().replace(/^_+|_+$/g,""),e=n.split("_").filter(Boolean),i=new Set;return n&&i.add(n),e.length>=1&&i.add(e[e.length-1]),e.length>=2&&i.add(e.slice(-2).join("_")),[...i]}export{_ as a};
|
|
3
|
-
//# sourceMappingURL=chunk-
|
|
3
|
+
//# sourceMappingURL=chunk-VN6B6HFB.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as u}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as u}from"./chunk-7I6KNKE3.js";import{a as c}from"./chunk-NN3O7TPH.js";import{existsSync as m}from"fs";import{basename as p,isAbsolute as g,join as d}from"path";function S(t,r){let e=f(t,r,{allowMultiple:!1})[0]?.relativePath;return e||x(t,r)}function j(t,r){return f(t,r,{allowMultiple:!0}).map(e=>e.relativePath)}function x(t,r){if(!r)return null;let e=r.replace(/\\/g,"/").replace(/^\.\//,""),s=g(e)&&e.startsWith(t.config.projectRoot)?e.slice(t.config.projectRoot.length).replace(/^\/+/,""):e,i=d(t.config.projectRoot,s);return m(i)?s:null}function f(t,r,e){let s=h(r);if(!s)return[];let i=c(t,{includeIgnored:!1}).map(o=>({relativePath:o,score:v(o,s)})).filter(o=>o.score>0).sort((o,l)=>l.score-o.score||o.relativePath.localeCompare(l.relativePath));if(i.length===0){let o=u(t,r);return!o||t.isIgnored(o.relativePath)?[]:[{relativePath:o.relativePath,score:700}]}let n=i.filter(o=>o.score>=1100);if(n.length>0)return e.allowMultiple?n:[n[0]];let a=i.filter(o=>o.score>=800);return a.length>0?e.allowMultiple?a:[a[0]]:e.allowMultiple?i:[i[0]]}function v(t,r){let e=h(t),s=p(e),i=p(r),n=0;return e===r&&(n+=1200),e.endsWith(`/${r}`)&&(n+=1100),s===i&&(n+=900),e.startsWith(`${r}/`)&&(n+=850),e.includes(r)&&(n+=250),n}function h(t){return t.trim().replace(/\\/g,"/").replace(/^\.\//,"").replace(/^\/+/,"").replace(/\/+$/,"")}export{S as a,j as b};
|
|
2
|
+
//# sourceMappingURL=chunk-WC43FMAB.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as P}from"./chunk-NN3O7TPH.js";import{a as j,d as O,e as w}from"./chunk-VDZL45XI.js";function G(t){return t.replace(/'''[\s\S]*?'''/g,f).replace(/"""[\s\S]*?"""/g,f).replace(/#.*$/gm,f).replace(/\/\/.*$/gm,f).replace(/\/\*[\s\S]*?\*\//g,f).replace(/`(?:\\[\s\S]|[^`])*`/g,f).replace(/'(?:\\.|[^'\\\r\n])*'/g,f).replace(/"(?:\\.|[^"\\\r\n])*"/g,f)}function f(t){return t.replace(/[^\r\n]/g," ")}var Tt=w("stripped-lines",{clearGroups:["whole-project","source-file"]});j({name:"stripped-source-singleton",groups:["whole-project","source-file"],clearAll:()=>{_=null,E=""},clearFile:()=>{_=null,E=""}});var _=null,E="";function V(t){return _===t||(_=t,E=G(t)),E}function Rt(t,n,e){let r=V(t);return`${r.slice(0,n)}${" ".repeat(e-n)}${r.slice(e)}`}function Dt(t,n){return new RegExp(`\\b${v(n)}\\b`,"m").test(t)}function $t(t,n){let e=new Set,r=new RegExp(`\\b${v(n)}\\s*\\.\\s*([A-Za-z_$][\\w$]*)`,"g");for(let o of t.matchAll(r)){let s=o[1];s&&e.add(s)}return[...e]}function v(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function yt(t){let n=0;for(let e of t)e==="("&&(n+=1),e===")"&&(n-=1);return n}import{existsSync as T}from"fs";import{basename as Y,dirname as S,extname as p,join as g,relative as h,resolve as u}from"path";var K=O("indexed-paths",{clearGroups:[]}),m=[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs",".vue"],X=[".py",".pyi"],b=[".java",".scala",".kt",".kts"],k=[".rs"],A=[".rb"],L=[".c",".h",".cc",".cpp",".cxx",".hpp",".hh",".hxx"],W=[".cs",".vb"],H=[".dart"],U=[".php"],Q=new Set(m),R=new Set(X),J=new Set(b),D=new Set(k),$=new Set(A),M=new Set(L),B=new Set(W),y=new Set(H),z=new Set(U),Z=[{extensions:m,lookup:Q},{extensions:X,lookup:R},{extensions:b,lookup:J},{extensions:k,lookup:D},{extensions:A,lookup:$},{extensions:L,lookup:M},{extensions:W,lookup:B},{extensions:H,lookup:y},{extensions:U,lookup:z}];function x(t,n){return n.has(p(t).toLowerCase())}function q(t){return x(t,R)}function tt(t){return x(t,J)}function nt(t){return x(t,D)}function et(t){return x(t,$)}function rt(t){return x(t,M)}function ot(t){return x(t,B)}function vt(t){return p(t).toLowerCase()===".vb"}function st(t){return x(t,y)}function it(t){return x(t,z)}function ct(t){let n=p(t).toLowerCase();for(let e of Z)if(e.lookup.has(n))return e.extensions;return m}function at(t){return tt(t)||ot(t)||it(t)}function Xt(t,n,e){return q(n)?ut(t,n,e):nt(n)?gt(t,n,e):et(n)?pt(t,n,e):rt(n)?ft(t,n,e):at(n)?St(t,e.replace(/\\/g,"."),ct(n)):st(n)?xt(t,n,e):lt(t,n,e)}function lt(t,n,e){if(!e.startsWith(".")&&!e.startsWith("/"))return null;let r=S(g(t.config.projectRoot,n)),o=u(r,e),s=N(t);for(let c of Nt(o)){let a=d(h(t.config.projectRoot,c));if(s.has(a)||T(c))return a}return d(h(t.config.projectRoot,o))}function ut(t,n,e){let r=N(t),o;if(e.startsWith(".")){let s=e.match(/^(\.+)(.*)$/);if(!s)return null;let c=s[1].length,a=s[2].replace(/^\./,""),i=S(g(t.config.projectRoot,n));for(let l=1;l<c;l++)i=S(i);o=a?u(i,a.replace(/\./g,"/")):i}else o=u(t.config.projectRoot,e.replace(/\./g,"/"));for(let s of dt(o)){let c=d(h(t.config.projectRoot,s));if(r.has(c)||T(s))return c}return null}function gt(t,n,e){if(!e)return null;let r=e.replace(/\s+as\s+.+$/,"").trim();if(!r.startsWith("crate::")&&!r.startsWith("self::")&&!r.startsWith("super::"))return null;let o=S(g(t.config.projectRoot,n)),s;return r.startsWith("crate::")?s=u(t.config.projectRoot,"src",r.slice(7).replace(/::/g,"/")):r.startsWith("self::")?s=u(o,r.slice(6).replace(/::/g,"/")):s=u(S(o),r.slice(7).replace(/::/g,"/")),C(t,Et(s))}function pt(t,n,e){let r=S(g(t.config.projectRoot,n)),o=u(r,e);return C(t,ht(o))}function ft(t,n,e){let r=S(g(t.config.projectRoot,n)),o=[u(r,e),u(t.config.projectRoot,e),u(t.config.projectRoot,"include",e),u(t.config.projectRoot,"src",e)];return C(t,o)}function St(t,n,e){let r=N(t),o=n.replace(/\\/g,".").replace(/::/g,".").replace(/^global::/,""),s=o.replace(/\./g,"/"),c=o.split(".").pop()??o;for(let i of e){let l=`${s}${i}`,I=[...r].find(F=>F.endsWith(l));if(I)return I}for(let i of e){let l=[...r].find(I=>Y(I)===`${c}${i}`);if(l)return l}let a=[...r].filter(i=>e.includes(p(i).toLowerCase())).filter(i=>i.includes(`/${s}/`)||i.includes(`/${c}/`)).sort((i,l)=>i.localeCompare(l));return a.length===1?a[0]:null}function xt(t,n,e){let r=N(t);if(e.startsWith("package:")){let c=e.slice(8),a=c.indexOf("/");if(a<0)return null;let i=c.slice(a+1),l=d(i.startsWith("lib/")?i:`lib/${i}`);return r.has(l)?l:null}let o=S(g(t.config.projectRoot,n)),s=u(o,e);for(let c of mt(s)){let a=d(h(t.config.projectRoot,c));if(r.has(a)||T(c))return a}return null}function dt(t){let n=p(t);return R.has(n)?[t]:[`${t}.py`,`${t}.pyi`,g(t,"__init__.py"),g(t,"__init__.pyi")]}function C(t,n){let e=N(t);for(let r of n){let o=d(h(t.config.projectRoot,r));if(e.has(o)||T(r))return o}return null}function Et(t){let n=p(t);return D.has(n)?[t]:[`${t}.rs`,g(t,"mod.rs")]}function ht(t){let n=p(t);return $.has(n)?[t]:[`${t}.rb`,g(t,"index.rb")]}function mt(t){let n=p(t);return y.has(n)?[t]:[`${t}.dart`,t]}function Nt(t){let n=p(t),e=new Set;if(n){e.add(t);for(let r of m)e.add(t.slice(0,-n.length)+r)}else for(let r of m)e.add(`${t}${r}`),e.add(g(t,`index${r}`));return[...e]}function N(t){return K.get(t,()=>new Set(P(t,{includeIgnored:!1}).map(d)))}function d(t){return t.replace(/\\/g,"/")}export{m as a,X as b,b as c,k as d,A as e,L as f,W as g,H as h,U as i,vt as j,ct as k,Xt as l,ut as m,gt as n,pt as o,ft as p,St as q,xt as r,d as s,G as t,Rt as u,Dt as v,$t as w,yt as x};
|
|
2
|
+
//# sourceMappingURL=chunk-WEJYUS5O.js.map
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{c as L,e as A}from"./chunk-VDZL45XI.js";import{existsSync as q,readFileSync as X}from"fs";import{join as $}from"path";var J=L("source-text",{clearGroups:["whole-project","source-file"]});function S(e,t){let r=t.replace(/\\/g,"/");return J.get(e,r,()=>{let n=$(e.config.projectRoot,r);return q(n)?X(n,"utf-8"):""})}var Z=/scip-query[\s:-]*ignore[\s:-]*(?:dead(?:-code)?|stale|wrapper|passthrough|drift|extract)?/i;function Pe(e,t,r){if(r<=0)return!1;let n=S(e,t);if(!n)return!1;let s=n.split(`
|
|
2
|
+
`);for(let a=r-1;a>=0&&a>=r-5;a-=1){let i=(s[a]??"").trim();if(i!==""){if(Z.test(i))return!0;if(!i.startsWith("//")&&!i.startsWith("*")&&!i.startsWith("/*")&&!i.startsWith("@")&&!i.startsWith("#"))return!1}}return!1}import{extname as w}from"path";var ee={".rs":"rust",".ts":"typescript",".mts":"typescript",".cts":"typescript",".tsx":"tsx",".js":"javascript",".jsx":"javascript",".mjs":"javascript",".cjs":"javascript",".py":"python",".pyi":"python",".java":"java",".kt":"kotlin",".kts":"kotlin",".scala":"scala",".sc":"scala",".rb":"ruby",".c":"c",".h":"c",".cc":"cpp",".cpp":"cpp",".cxx":"cpp",".hpp":"cpp",".hh":"cpp",".hxx":"cpp",".cs":"csharp",".php":"php",".vb":"vb"};function y(e){return ee[w(e).toLowerCase()]??null}function x(e){return w(e).toLowerCase()===".vue"}import{createRequire as te}from"module";var f=te(import.meta.url),b=null,F=!1;function re(){if(F)return null;if(b)return b;try{return b=f("tree-sitter"),b}catch{return F=!0,null}}var k=new Map,_=new Set;function ne(e){if(_.has(e))return null;let t=k.get(e);if(t)return t;let r;try{switch(e){case"rust":r=f("tree-sitter-rust");break;case"typescript":r=f("tree-sitter-typescript").typescript;break;case"tsx":r=f("tree-sitter-typescript").tsx;break;case"javascript":r=f("tree-sitter-javascript");break;case"python":r=f("tree-sitter-python");break;case"java":r=f("tree-sitter-java");break;case"kotlin":r=f("tree-sitter-kotlin");break;case"scala":r=f("tree-sitter-scala");break;case"ruby":r=f("tree-sitter-ruby");break;case"c":r=f("tree-sitter-c");break;case"cpp":r=f("tree-sitter-cpp");break;case"csharp":r=f("tree-sitter-c-sharp");break;case"php":r=f("tree-sitter-php").php;break;case"vb":{let n=f("tree-sitter-vb-dotnet");r=n.language??n;break}}}catch{return _.add(e),null}return k.set(e,r),r}var R=new Map;function se(e){let t=R.get(e);if(t)return t;let r=ne(e);if(!r)return null;let n=re();if(!n)return null;let s=new n;try{s.setLanguage(r)}catch{return _.add(e),null}return R.set(e,s),s}function ae(e,t){return e.parse(n=>n>=t.length?null:t.slice(n,Math.min(t.length,n+16384)))}function C(e,t){let r=se(e);if(!r)return null;try{return ae(r,t)}catch{return null}}function T(e){let t=[],r=/<script\b([^>]*)>([\s\S]*?)<\/script>/g;for(let o of e.matchAll(r))typeof o.index=="number"&&t.push({tagOpen:o[1]??"",body:o[2]??"",openIdx:o.index+(o[0].length-(o[2]?.length??0)-9)});if(t.length===0)return null;let n=t.find(o=>/\bsetup\b/.test(o.tagOpen))??t[0],a=n.tagOpen.match(/\blang\s*=\s*["']?([\w-]+)/)?.[1]?.toLowerCase(),i=a==="ts"||a==="typescript"?"typescript":a==="tsx"?"tsx":"javascript";return{body:n.body,startLine:ie(e,n.openIdx),language:i}}function ie(e,t){let r=0;for(let n=0;n<t&&n<e.length;n++)e.charCodeAt(n)===10&&r++;return r}var j=A("ast-trees",{clearGroups:["whole-project","source-file"]});function N(e,t){if(x(t))return oe(e,t);let r=y(t);if(!r)return null;let n=S(e,t);return n?j.get(e,t,n,()=>C(r,n)):null}function oe(e,t){let r=S(e,t);return r?j.get(e,t,r,()=>{let n=T(r);if(!n)return null;let s=`
|
|
3
|
+
`.repeat(n.startLine)+n.body;return C(n.language,s)}):null}function h(e){return e.type==="comment"||e.type==="line_comment"||e.type==="block_comment"}var ce=new Set(["function_declaration","method_definition","method_signature","function_signature"]);function D(e,t){let r=le(e,t);if(r)return{name:r.name,startLine:r.definitionNode.startPosition.row,endLine:r.definitionNode.endPosition.row,paramCount:I(r.functionNode),params:E(r.functionNode),paramsEndLine:v(r.functionNode),isLiteralPassthrough:P(r.functionNode,t)};if(!ue(e.type,t))return null;let n=e.childForFieldName("name")??e.namedChildren.find(s=>s.type==="identifier"||s.type==="property_identifier");return n?{name:n.text,startLine:e.startPosition.row,endLine:e.endPosition.row,paramCount:I(e),params:E(e),paramsEndLine:v(e),isLiteralPassthrough:P(e,t)}:null}function M(e){return e.namedChildren.find(t=>t.type==="parameters"||t.type==="formal_parameters")}function E(e){let t=M(e);if(!t)return[];let r=[];for(let n of t.namedChildren){if(h(n))continue;if(n.type==="identifier"){r.push({name:n.text,simple:!0});continue}let s=n.namedChildren.some(o=>o.type.endsWith("_modifier"))||/^\s*(?:public|private|protected|readonly|override)\b/.test(n.text),a=n.childForFieldName("pattern");if(!s&&a&&a.type==="identifier"){r.push({name:a.text,simple:!0});continue}let i=n.namedChildren.find(o=>o.type==="identifier");r.push({name:a?.type==="identifier"?a.text:i?.text??"",simple:!1})}return r}function v(e){let t=M(e);return t?t.endPosition.row:e.startPosition.row}function ue(e,t){return t==="rust"?e==="function_item"||e==="function_signature_item":t==="python"?e==="function_definition":t==="typescript"||t==="tsx"||t==="javascript"?ce.has(e):!1}function le(e,t){if(t!=="typescript"&&t!=="tsx"&&t!=="javascript")return null;if(e.type==="variable_declarator"){let r=e.childForFieldName("name")??e.namedChild(0),n=e.childForFieldName("value")??e.namedChild(1);return!r||!n||n.type!=="arrow_function"&&n.type!=="function_expression"?null:{name:r.text,definitionNode:e,functionNode:n}}if(e.type==="public_field_definition"){let r=e.childForFieldName("name")??e.namedChild(0),n=e.childForFieldName("value")??e.namedChild(1);return!r||!n||n.type!=="arrow_function"&&n.type!=="function_expression"?null:{name:r.text,definitionNode:e,functionNode:n}}return null}function I(e){let t=e.namedChildren.find(n=>n.type==="parameters"||n.type==="formal_parameters");if(!t)return 0;let r=0;for(let n of t.namedChildren)h(n)||(r+=1);return r}function P(e,t){let r=e.namedChildren.find(l=>l.type==="block"||l.type==="statement_block");if(!r)return!1;let n=r.namedChildren.filter(l=>!h(l));if(n.length!==1)return!1;let s=n[0],a=null;if(s.type==="return_statement"||s.type==="expression_statement"?a=s.namedChild(0)??null:t==="rust"&&(s.type==="call_expression"||s.type==="macro_invocation")&&(a=s),!a)return!1;let i=t==="python"?"call":"call_expression";if(a.type!==i)return!1;let o=a.namedChildren.find(l=>l.type==="arguments"||l.type==="argument_list");if(!o)return!1;let u=o.namedChildren.filter(l=>!h(l)),c=e.namedChildren.find(l=>l.type==="parameters"||l.type==="formal_parameters");if(!c)return!1;let p=[];for(let l of c.namedChildren){if(l.type==="identifier"){p.push(l.text);continue}let d=l.namedChildren.find(K=>K.type==="identifier");d&&p.push(d.text)}if(u.length!==p.length)return!1;for(let l=0;l<p.length;l+=1){let d=u[l];if(d.type!=="identifier"||d.text!==p[l])return!1}return!0}function O(e,t){let r=pe(e,t);if(!r)return null;let n=g(r);return n?{calleeLeaf:n,memberAccess:fe(r),line:e.startPosition.row}:null}function pe(e,t){if(t==="rust")return e.type==="call_expression"?e.childForFieldName("function")??e.namedChild(0):e.type==="macro_invocation"?e.childForFieldName("macro")??e.namedChild(0):null;if(t==="python")return e.type!=="call"?null:e.childForFieldName("function")??e.namedChild(0);if(t==="typescript"||t==="tsx"||t==="javascript"){if(e.type==="call_expression")return e.childForFieldName("function")??e.namedChild(0);if(e.type==="new_expression")return e.childForFieldName("constructor")??e.namedChild(0)}return null}function fe(e){switch(e.type){case"field_expression":case"member_expression":case"attribute":return!0;default:return!1}}function g(e){switch(e.type){case"identifier":case"type_identifier":case"property_identifier":case"shorthand_property_identifier":return e.text;case"field_expression":case"member_expression":case"attribute":{let t=e.namedChild(e.namedChildCount-1);return t?g(t):null}case"scoped_identifier":{let t=e.childForFieldName("name")??e.namedChild(e.namedChildCount-1);return t?g(t):null}case"super":case"self":case"this":return null;default:return null}}var me=new Set(["identifier","type_identifier","field_identifier"]),de=new Set(["identifier"]),ge=new Set(["identifier","property_identifier","type_identifier","shorthand_property_identifier","shorthand_property_identifier_pattern"]),ye=new Set(["rust","python"]),he=/\{([^{}]*)\}/g,Se=/\b([A-Za-z_][\w]*)\b/g;function B(e,t){return be(t).has(e.type)}function Q(e,t){return ye.has(t)&&e.type==="string_content"}function H(e){let t=0;for(let n of e.values()){let s=n[n.length-1];s!==void 0&&s>t&&(t=s)}let r=new Array(t+1);for(let n=0;n<=t;n+=1)r[n]=new Set;for(let[n,s]of e)for(let a of s)r[a].add(n);return r}function be(e){return e==="rust"?me:e==="python"?de:ge}function V(e,t){let r=e.startPosition.row;for(let n of e.text.matchAll(he)){let s=n[1]??"";for(let a of s.matchAll(Se))a[1]&&t(a[1],r)}}var xe=[/\bdefault\s*=\s*"([^"]+)"/g,/\bwith\s*=\s*"([^"]+)"/g,/\bserialize_with\s*=\s*"([^"]+)"/g,/\bdeserialize_with\s*=\s*"([^"]+)"/g,/\bskip_serializing_if\s*=\s*"([^"]+)"/g,/\bgetter\s*=\s*"([^"]+)"/g,/\brename_all_with\s*=\s*"([^"]+)"/g,/\bschema_with\s*=\s*"([^"]+)"/g],_e=/^#!?\[\s*serde\s*\(/,Ce=/^#!?\[\s*schemars\s*\(/,Ne=/^#!?\[\s*validate\s*\(/,Le=new Set(["invoke","invokeTauriCommand","listen","once","emit","subscribe","dispatch","sendCommand","callRust"]);function G(e,t,r){if(t!=="typescript"&&t!=="tsx"&&t!=="javascript"||e.type!=="call_expression")return;let n=e.childForFieldName("function")??e.namedChild(0);if(!n)return;let s=g(n);if(!s||!Le.has(s))return;let a=e.namedChildren.find(u=>u.type==="arguments");if(!a)return;let i=a.namedChild(0);if(!i||i.type!=="string")return;let o=i.namedChildren.find(u=>u.type==="string_fragment");o&&r.add(o.text)}function U(e,t){let r=_e.test(e),n=Ce.test(e),s=Ne.test(e);if(!(!r&&!n&&!s))for(let a of xe){a.lastIndex=0;let i;for(;(i=a.exec(e))!==null;){let o=i[1],u=o.split("::").pop()??o;u==="is_none"&&/\bOption\b/.test(o)||u==="is_empty"&&/\b(String|Vec|HashMap|BTreeMap|HashSet|BTreeSet)\b/.test(o)||u&&t.add(u)}}}function z(e,t){let r=new Map,n=(i,o)=>{if(i===o)return;let u=r.get(i);u||(u=new Set,r.set(i,u)),u.add(o)},s=t==="python"?new Set(["identifier"]):new Set(["type_identifier"]),a=(i,o)=>{let u=c=>{s.has(c.type)&&c.text!==o&&n(c.text,o);for(let p of c.children)u(p)};for(let c of i.children)u(c)};if(t==="rust")for(let i of e.rootNode.descendantsOfType(["struct_item","enum_item","union_item","type_item"])){let o=i.namedChildren.find(c=>c.type==="type_identifier")?.text;if(!o)continue;let u=i.namedChildren.find(c=>c.type==="field_declaration_list"||c.type==="enum_variant_list"||c.type==="ordered_field_declaration_list");u&&a(u,o),i.type==="type_item"&&a(i,o)}else if(t==="python")for(let i of e.rootNode.descendantsOfType("class_definition")){let o=i.namedChildren.find(c=>c.type==="identifier")?.text;if(!o)continue;let u=i.namedChildren.find(c=>c.type==="block");if(u)for(let c of u.descendantsOfType("type"))for(let p of c.descendantsOfType("identifier"))p.text!==o&&n(p.text,o)}else for(let i of e.rootNode.descendantsOfType(["interface_declaration","type_alias_declaration","class_declaration"])){let o=i.namedChildren.find(u=>u.type==="type_identifier")?.text;o&&a(i,o)}return r}var W=new WeakMap;function m(e,t){let r=y(t);if(!r)return null;let n=N(e,t);if(!n)return null;let s=W.get(n);if(s)return s;let a=Fe(n,r);return W.set(n,a),a}function Ae(e,t,r,n){let s=m(e,t);return s?we(s,r,n)?.isLiteralPassthrough??!0:!0}function we(e,t,r){return e.callables.find(n=>n.startLine===t&&n.endLine===r)??null}function Fe(e,t){let r=[],n=[],s=new Set,a=new Set,i=new Map,o=(c,p)=>{let l=i.get(c);if(!l){i.set(c,[p]);return}l[l.length-1]!==p&&l.push(p)},u=c=>{let p=D(c,t);p&&r.push(p);let l=O(c,t);l&&n.push(l),G(c,t,a),t==="rust"&&(c.type==="attribute_item"||c.type==="inner_attribute_item")&&U(c.text,s),B(c,t)&&o(c.text,c.startPosition.row),Q(c,t)&&V(c,o);for(let d of c.children)u(d)};return u(e.rootNode),{language:t,callables:r,callSites:n,typeContainerMap:z(e,t),identifierLineMap:i,identifiersByLine:H(i),fileIdentifiers:new Set(i.keys()),rustAttrReferencedNames:s,crossLanguageDispatchNames:a}}var Y=new Set(["rust","typescript","tsx","javascript","python"]);function ke(e,t){let r=m(e,t);return!r||!Y.has(r.language)?null:r.callables.map(n=>({name:n.name,startLine:n.startLine,endLine:n.endLine}))}function Re(e,t){let r=m(e,t);return!r||!Y.has(r.language)?null:r.callSites}function Te(e,t){return m(e,t)?.typeContainerMap??new Map}function je(e,t,r={}){let n=m(e,t);if(!n)return[];let s=[];if(r.includeCrossLanguageDispatchNames)for(let a of n.crossLanguageDispatchNames)s.push({name:a,kind:"cross-language-dispatch",occurrences:1});if(r.includeRustAttributeNames&&n.language==="rust")for(let a of n.rustAttrReferencedNames)s.push({name:a,kind:"rust-attribute",occurrences:1});return s}export{S as a,Pe as b,y as c,x as d,N as e,m as f,Ae as g,ke as h,Re as i,Te as j,je as k};
|
|
4
|
+
//# sourceMappingURL=chunk-WQFOZIID.js.map
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{a as G}from"./chunk-HVGNOUYP.js";import{a as L}from"./chunk-AQYBOORI.js";import{a as F}from"./chunk-DJTJ3DLZ.js";import{a as E}from"./chunk-SSINY7HL.js";import{a as x}from"./chunk-QYQXPPDI.js";import{a as B}from"./chunk-SLOIQKY7.js";import{a as N,b as v}from"./chunk-K4Z3FCUJ.js";import{a as A}from"./chunk-HVXIXDLV.js";import{a as D}from"./chunk-6P5W4U6G.js";import{c as R}from"./chunk-OQSV6OS2.js";import{a as w}from"./chunk-2EC4JTHC.js";import{b as k}from"./chunk-OIMM7KMI.js";import{a as p}from"./chunk-4A4JFNWG.js";import{f as $}from"./chunk-N5D5ZCBW.js";import{a as C}from"./chunk-EKP7XJ6L.js";import{a as S}from"./chunk-NOVKLH2F.js";import{e as h,f as d}from"./chunk-TQTVM27C.js";import{existsSync as j}from"fs";import{existsSync as H,readFileSync as I,writeFileSync as T}from"fs";import{isAbsolute as O,join as M}from"path";var U=75e3,q=5e3,z=2500;function J(e){let i=L(e);return i.symbols>=U||i.documents>=q?z:void 0}var K=".scipquery-baseline.json";function u(e,i){return i&&O(i)?i:M(e.config.projectRoot,i??K)}function P(e,i={}){let{scope:t}=i,s=J(e),o=[],f=k(e,{scope:t,minLoc:3,skipBarrels:!0,deadCodeOnly:!0,scanLimit:s,semantic:!1});for(let n of f.symbols)h(e,n.relativePath)||d(e,n.symbol,n.relativePath)||n.kind==="dead-code"&&o.push(`dead:${n.relativePath}:${n.shortName}`);for(let n of x(e,{scope:t,minLoc:3,scanLimit:s,semantic:!1}))h(e,n.relativePath)||d(e,n.symbol,n.relativePath)||o.push(`isolated:${n.relativePath}:${n.shortName}`);for(let n of C(e,{scope:t}))n.kind==="real"&&o.push(`cycle:${W(n.path)}`);for(let n of v(e,{scope:t,minSimilarity:.6,limit:50,minCallees:4,scanLimit:s,semantic:!1}))o.push(`similar:${[n.symbolA,n.symbolB].sort().join("|")}`);for(let n of A(e,{scope:t,minLoc:15,minCallees:5,limit:50,scanLimit:s,semantic:!1}))o.push(`extract:${n.relativePath}:${n.shortName}`);for(let n of F(e,{scope:t,maxLoc:15,limit:50,scanLimit:s,semantic:!1}))o.push(`wrapper:${n.file}:${n.shortName}`);for(let n of B(e,{scope:t,maxLoc:15,limit:50,scanLimit:s,semantic:!1}))o.push(`passthrough:${n.file}:${n.shortName}`);for(let n of E(e,{scope:t,minLoc:3,limit:50,scanLimit:s,semantic:!1}))o.push(`stale:${n.file}:${n.shortName}`);for(let n of w(e,{scope:t,semantic:!1}).results)n.kind!=="pattern-deviation"&&o.push(`drift:${n.kind}:${n.file}:${n.dep}`);return[...new Set(o)].sort()}function W(e){if(e.length===0)return"";let i=0;for(let t=1;t<e.length;t++)e[t]<e[i]&&(i=t);return[...e.slice(i),...e.slice(0,i)].join(">")}function ue(e,i={}){let t=P(e,{scope:i.scope}),s=u(e,i.path);return T(s,JSON.stringify({version:1,findings:t},null,2)+`
|
|
2
|
+
`),{path:s,findingCount:t.length}}function _(e,i={}){let t=u(e,i.path);if(!H(t))throw new Error(`No baseline found at ${t}. Create one with: scip-query health --write-baseline`);let s=JSON.parse(I(t,"utf-8")),o=new Set(s.findings??[]),f=P(e,{scope:i.scope}),n=new Set(f);return{baselinePath:t,baselineCount:o.size,current:f,newFindings:f.filter(a=>!o.has(a)),fixedFindings:[...o].filter(a=>!n.has(a))}}function Ae(e,i={}){let t=i.base??"HEAD",{minTogether:s=6,minConfidence:o=.6,maxEchoChecks:f=10,minSimilarity:n=.8}=i,a=D(e,{base:t}),r=a.changedFiles,l=new Set(r),c={base:t,changedFiles:r,changedSymbols:a.changedSymbols.length,checksRun:[],skipped:[],findings:[],note:a.summary.note};return r.length===0||(Y(e,a.changedSymbols,l,f,n,c),Q(e,l,s,o,c),V(e,l,c),X(e,r,c),Z(e,a.changedSymbols,c),ee(e,c)),c}function Y(e,i,t,s,o,f){f.checksRun.push("echo");for(let n of i.slice(0,s)){let a=N(e,n.symbol,{minSimilarity:o,limit:3});for(let r of a){let l=r.fileA===n.file?r.fileB:r.fileA,c=r.fileA===n.file?r.shortNameB:r.shortNameA;t.has(l)||f.findings.push({check:"echo",message:`${n.shortName} (${n.file}) is ${Math.round(r.similarity*100)}% similar to established ${c} (${l})`,remediation:`Extend or reuse ${c} instead of keeping the re-implementation.`})}}i.length>s&&f.skipped.push({check:"echo",reason:`echo check capped at ${s} of ${i.length} changed symbols`})}function Q(e,i,t,s,o){let f=$(e,{minTogether:t,minConfidence:0});if(!f){o.skipped.push({check:"co-change-partner",reason:"no git history"});return}o.checksRun.push("co-change-partner");let n=new Set;for(let a of f){let r=i.has(a.fileA),l=i.has(a.fileB);if(r===l)continue;let c=r?a.fileA:a.fileB,m=r?a.fileB:a.fileA,g=r?a.changesA:a.changesB,y=g>0?a.together/g:0;if(y<s||p(m)||p(c)||!j(`${e.config.projectRoot}/${m}`))continue;let b=`${c}|${m}`;n.has(b)||(n.add(b),o.findings.push({check:"co-change-partner",message:`${c} changed, but ${m} did not \u2014 they change together ${a.together}x (${Math.round(y*100)}% of the time)`,remediation:`Update ${m} alongside this change, or confirm the coupling no longer holds.`}))}}function V(e,i,t){t.checksRun.push("doc-reference");for(let s of R(e,i))i.has(s.doc)||t.findings.push({check:"doc-reference",message:`${s.doc} cites ${s.cited.join(", ")} \u2014 changed in this diff, doc untouched`,remediation:`Re-read ${s.doc} and update its claims, or update its citations.`})}function X(e,i,t){t.checksRun.push("unused-params");for(let s of G(e,{files:i,limit:50}))t.findings.push({check:"unused-params",message:`${s.shortName} (${s.file}) has trailing unused parameter(s): ${s.unusedTrailing.join(", ")}`,remediation:"Drop the unused trailing parameters and their call-site arguments."})}function Z(e,i,t){t.checksRun.push("new-dead");let s=new S(e);for(let o of i)o.fanIn>0||s.fileKind(o.file)!=="test"&&(h(e,o.file)||d(e,o.symbol,o.file)||t.findings.push({check:"new-dead",message:`${o.shortName} (${o.file}) was changed but has zero indexed consumers`,remediation:"Wire it up, or remove it before it becomes permanent dead code."}))}function ee(e,i){if(!j(u(e))){i.skipped.push({check:"baseline",reason:"no .scipquery-baseline.json \u2014 run health --write-baseline to enable"});return}i.checksRun.push("baseline");let t=_(e);for(let s of t.newFindings)i.findings.push({check:"baseline",message:`new finding vs committed baseline: ${s}`,remediation:"Fix the finding, or knowingly accept it via health --write-baseline."})}export{P as a,ue as b,_ as c,Ae as d};
|
|
3
|
+
//# sourceMappingURL=chunk-XBFLIGWU.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{c as b}from"./chunk-MX6F756F.js";import{a as u}from"./chunk-NOVKLH2F.js";import{a as f}from"./chunk-EAU4RDFG.js";import{a as c}from"./chunk-PCMVXWDC.js";import{c as l}from"./chunk-SOGLYIJ4.js";function R(o,e={}){let{limit:r=20,scope:s,minFanIn:i=2,minFanOut:n=2,scanLimit:m}=e,p=new u(o);return b(p.productionCallableDefinitions({scope:s,requireCallableSymbol:!0,includeSuppressed:!0,sortByLocDesc:typeof m=="number"&&m>0}),m).map(t=>y(o,t,e.semantic!==!1)).filter(t=>t.fanIn>=i&&t.fanOut>=n).sort((t,a)=>a.score-t.score||a.fanIn-t.fanIn).slice(0,r)}function y(o,e,r){let s=new Set(f(o,e,{limit:500,semantic:r}).map(n=>n.file)).size,i=new Set(c(o,e,{limit:500,semantic:r}).filter(n=>n.file!==e.relativePath).map(n=>`${n.symbol}|${n.file}`)).size;return{symbol:e.symbol,shortName:l(e.symbol),fanIn:s,fanOut:i,score:s*i,definedIn:e.relativePath}}export{R as a};
|
|
2
|
+
//# sourceMappingURL=chunk-XSZ5NC4O.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{a as m}from"./chunk-
|
|
1
|
+
import{a as m}from"./chunk-WC43FMAB.js";import{a as h}from"./chunk-7I6KNKE3.js";import{c as p}from"./chunk-SOGLYIJ4.js";import{readFileSync as f}from"fs";import{extname as y,join as d}from"path";function M(t,e,a={}){let{context:s=0}=a,r=L(e);if(r)return j(t,r.filePath,r.startLine,r.endLine,s);let l=h(t,e);return l?R(t,l,s):null}function L(t){let e=t.match(/^(.+\.\w+):(\d+)-(\d+)$/);return e?{filePath:e[1],startLine:parseInt(e[2],10),endLine:parseInt(e[3],10)}:null}function R(t,e,a){let s=t.get("SELECT language FROM documents WHERE relative_path = ?",e.relativePath),r=d(t.config.projectRoot,e.relativePath),l;try{l=f(r,"utf-8")}catch{return null}let n=l.split(`
|
|
2
2
|
`),c=Math.max(0,e.startLine-a),i=Math.min(n.length-1,e.endLine+a),u=n.slice(c,i+1).join(`
|
|
3
3
|
`);return{symbol:e.symbol,shortName:p(e.symbol),relativePath:e.relativePath,startLine:c,endLine:i,language:s?.language??v(e.relativePath),source:u}}function j(t,e,a,s,r){let l=m(t,e);if(!l)return null;let n=t.get("SELECT relative_path, language FROM documents WHERE relative_path = ?",l);if(!n)return null;let c=d(t.config.projectRoot,n.relative_path),i;try{i=f(c,"utf-8")}catch{return null}let u=i.split(`
|
|
4
4
|
`),o=Math.max(0,a-1-r),g=Math.min(u.length-1,s-1+r),b=u.slice(o,g+1).join(`
|
|
5
5
|
`);return{symbol:`${n.relative_path}:${a}-${s}`,shortName:`${n.relative_path}:${a}-${s}`,relativePath:n.relative_path,startLine:o,endLine:g,language:n.language??v(n.relative_path),source:b}}function v(t){switch(y(t).toLowerCase()){case".ts":case".tsx":case".mts":case".cts":return"typescript";case".js":case".jsx":case".mjs":case".cjs":return"javascript";case".py":case".pyi":return"python";case".rs":return"rust";case".go":return"go";case".java":return"java";case".kt":case".kts":return"kotlin";case".scala":return"scala";case".rb":return"ruby";case".php":return"php";case".cs":return"csharp";case".vb":return"vb";case".dart":return"dart";case".c":case".h":return"c";case".cc":case".cpp":case".cxx":case".hpp":case".hh":case".hxx":return"cpp";case".vue":return"vue";default:return null}}export{M as a};
|
|
6
|
-
//# sourceMappingURL=chunk-
|
|
6
|
+
//# sourceMappingURL=chunk-Z2AJQ7VA.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a}from"./chunk-NOVKLH2F.js";import{a as i}from"./chunk-7I6KNKE3.js";import{c as s,e as o,k as m}from"./chunk-SOGLYIJ4.js";function L(t,l){let r=i(t,l);return r?new a(t).definitionsForFile(r.relativePath).filter(e=>e.symbol!==r.symbol).filter(e=>m(r.symbol,e.symbol)).sort((e,n)=>e.startLine-n.startLine||e.endLine-n.endLine).map(e=>({symbol:e.symbol,shortName:s(e.symbol),startLine:e.startLine,endLine:e.endLine,kind:o(e.symbol)??"unknown"})):[]}export{L as a};
|
|
2
|
+
//# sourceMappingURL=chunk-ZIIQ55VK.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{b}from"./chunk-WC43FMAB.js";import{l as d,u as f}from"./chunk-SOGLYIJ4.js";function S(a,g){let p=b(a,g),i=f(a,p,{sort:!0});if(i.length===0)return[];let o=i.map(e=>({symbol:e.symbol,shortName:e.shortName,startLine:e.startLine,endLine:e.endLine,signature:e.signature,children:[]})),s=new Map;for(let e of o)s.set(e.symbol,e);let c=[];for(let e=0;e<i.length;e++){let r=i[e],n=o[e];if(r.enclosingSymbol&&s.has(r.enclosingSymbol)){s.get(r.enclosingSymbol).children.push(n);continue}let l=null,m=1/0;for(let t of o)if(t!==n&&t.startLine<=n.startLine&&t.endLine>=n.endLine){if(t.startLine===n.startLine&&t.endLine===n.endLine&&!d(t.symbol,n.symbol))continue;let u=t.endLine-t.startLine;u<m&&(m=u,l=t)}l?l.children.push(n):c.push(n)}return c}export{S as a};
|
|
2
|
+
//# sourceMappingURL=chunk-ZJ737ZMD.js.map
|