scip-query 0.4.3 → 0.5.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/dist/{chunk-46ZTW4AI.js → chunk-2MQ5DPY6.js} +2 -2
- package/dist/{chunk-FIMTTUGE.js → chunk-2QTYIOJ5.js} +2 -2
- package/dist/{chunk-YQIWS5V6.js → chunk-3VI4YXCL.js} +2 -2
- package/dist/{chunk-UIRCHPOU.js → chunk-3VV2G6U7.js} +3 -3
- package/dist/{chunk-PKDFXASW.js → chunk-44PFXVXG.js} +2 -2
- package/dist/{chunk-XJSPWHNT.js → chunk-6SLFQR36.js} +2 -2
- package/dist/{chunk-334PCFO3.js → chunk-7DBPRGMS.js} +12 -12
- package/dist/{chunk-B7LDMCUS.js → chunk-DTB724R3.js} +2 -2
- package/dist/{chunk-R2QBMQQN.js → chunk-FLOYI6I4.js} +3 -3
- package/dist/{chunk-4TYLS5XX.js → chunk-GJT3MO2T.js} +9 -2
- package/dist/{chunk-7KGTWDAX.js → chunk-HAP4LJKX.js} +7 -28
- package/dist/{chunk-E74RY6AQ.js → chunk-JCOJQ4I6.js} +2 -2
- package/dist/{chunk-J34HAAEQ.js → chunk-JGQMOS4V.js} +2 -2
- package/dist/{chunk-T6UVM534.js → chunk-JMD4WJ2Q.js} +2 -2
- package/dist/{chunk-UNS6ZQVX.js → chunk-JSQPZOPO.js} +10 -17
- package/dist/{chunk-ZPEI7DRJ.js → chunk-JZN3DRCT.js} +14 -21
- package/dist/{chunk-NYZ6INK3.js → chunk-KMWYB3CX.js} +11 -35
- package/dist/{chunk-B747RITP.js → chunk-MRM755FU.js} +7 -8
- package/dist/{chunk-AEBM56CO.js → chunk-N2XO3Z5F.js} +2 -2
- package/dist/{chunk-PSK5BPFE.js → chunk-OLW5UL36.js} +18 -24
- package/dist/{chunk-FMAYH7GS.js → chunk-OMCRXXDX.js} +72 -14
- package/dist/{chunk-6PVHJ332.js → chunk-OWJOHUZE.js} +2 -2
- package/dist/{chunk-IC5NTO47.js → chunk-PEDH3D4G.js} +2 -2
- package/dist/{chunk-U74VYTLX.js → chunk-POAN4SCR.js} +2 -2
- package/dist/{chunk-5YB6UXQ3.js → chunk-PTMGEBU3.js} +2 -2
- package/dist/{chunk-LQXBFCP2.js → chunk-PU44HK7P.js} +2 -2
- package/dist/{chunk-QZ4FRB65.js → chunk-QJI7EECA.js} +15 -29
- package/dist/{chunk-C2VSV54P.js → chunk-R5HICGMB.js} +3 -3
- package/dist/{chunk-NWXTQGUE.js → chunk-RJ2D6YWQ.js} +2 -2
- package/dist/{chunk-PGQXIAJF.js → chunk-RZ5GYPBP.js} +2 -2
- package/dist/chunk-SRLQNO6O.js +101 -0
- package/dist/{chunk-OMVF3BHY.js → chunk-UGS7HJI4.js} +2 -2
- package/dist/{chunk-7OGXSMLY.js → chunk-VKUUXOE7.js} +2 -2
- package/dist/{chunk-XMZAC2VU.js → chunk-VPUJSJCI.js} +2 -2
- package/dist/{chunk-NNFP4ZRF.js → chunk-VRWVV3EP.js} +2 -2
- package/dist/{chunk-HESWGDIV.js → chunk-WJWQEU4A.js} +2 -2
- package/dist/chunk-WJZHDUSB.js +40 -0
- package/dist/{chunk-HL2LXSBW.js → chunk-WWOCQ5W4.js} +2 -2
- package/dist/chunk-X3Q2OVRL.js +77 -0
- package/dist/chunk-Y3P7QKKN.js +27 -0
- package/dist/{chunk-DIYEUFVP.js → chunk-Y6FAHY4N.js} +2 -2
- package/dist/{chunk-4YN3PE57.js → chunk-ZDL3U4W2.js} +2 -2
- package/dist/{chunk-HW76DVE4.js → chunk-ZXNX5JRE.js} +2 -2
- package/dist/cli.js +175 -355
- package/dist/index.js +43 -43
- package/dist/queries/affected.js +2 -2
- package/dist/queries/bottlenecks.js +2 -2
- package/dist/queries/by-kind.js +2 -2
- package/dist/queries/call-graph.js +2 -2
- package/dist/queries/change-surface.d.ts +3 -0
- package/dist/queries/change-surface.js +2 -2
- package/dist/queries/clean-signature.d.ts +9 -1
- package/dist/queries/clean-signature.js +5 -3
- package/dist/queries/code.js +2 -2
- package/dist/queries/complexity-hotspots.d.ts +7 -0
- package/dist/queries/complexity-hotspots.js +2 -2
- package/dist/queries/complexity.js +2 -2
- package/dist/queries/convergence.js +2 -2
- package/dist/queries/coupling.js +2 -2
- package/dist/queries/cycles.js +2 -2
- package/dist/queries/dataflow.js +2 -2
- package/dist/queries/dead.js +3 -3
- package/dist/queries/deep-chains.js +2 -2
- package/dist/queries/deps.js +2 -2
- package/dist/queries/drift.js +2 -2
- package/dist/queries/extract-candidates.js +2 -2
- package/dist/queries/fan.js +2 -2
- package/dist/queries/health.js +13 -13
- package/dist/queries/hierarchy.js +2 -2
- package/dist/queries/hotspots.js +2 -2
- package/dist/queries/imports.js +2 -2
- package/dist/queries/index.js +43 -43
- package/dist/queries/isolated.js +3 -3
- package/dist/queries/members.d.ts +3 -0
- package/dist/queries/members.js +2 -2
- package/dist/queries/methods.js +2 -2
- package/dist/queries/outline.d.ts +3 -0
- package/dist/queries/outline.js +2 -2
- package/dist/queries/passthrough-candidates.js +2 -2
- package/dist/queries/redundant-reexports.js +3 -3
- package/dist/queries/refs.js +2 -2
- package/dist/queries/similar-chains.js +2 -2
- package/dist/queries/similar-files.js +2 -2
- package/dist/queries/similar-signatures.js +2 -2
- package/dist/queries/similar.js +2 -2
- package/dist/queries/slice.js +2 -2
- package/dist/queries/stale-abstractions.js +2 -2
- package/dist/queries/surface.js +2 -2
- package/dist/queries/symbols.js +3 -3
- package/dist/queries/system.d.ts +5 -1
- package/dist/queries/system.js +3 -3
- package/dist/queries/trace.js +3 -3
- package/dist/queries/wrapper-candidates.js +2 -2
- package/package.json +1 -1
- package/dist/chunk-NML6M5AS.js +0 -37
- package/dist/chunk-T3ALCNCP.js +0 -113
- package/dist/chunk-VJMTX3OR.js +0 -115
- package/dist/chunk-Y7FKURZG.js +0 -130
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
buildFileDepGraph
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-OMCRXXDX.js";
|
|
4
4
|
|
|
5
5
|
// src/queries/cycles.ts
|
|
6
6
|
function cycles(db, opts = {}) {
|
|
@@ -58,4 +58,4 @@ function cycles(db, opts = {}) {
|
|
|
58
58
|
export {
|
|
59
59
|
cycles
|
|
60
60
|
};
|
|
61
|
-
//# sourceMappingURL=chunk-
|
|
61
|
+
//# sourceMappingURL=chunk-2MQ5DPY6.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
buildFileDepGraph
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-OMCRXXDX.js";
|
|
4
4
|
|
|
5
5
|
// src/queries/drift.ts
|
|
6
6
|
import path from "path";
|
|
@@ -162,4 +162,4 @@ function isTestLikePath(filePath) {
|
|
|
162
162
|
export {
|
|
163
163
|
drift
|
|
164
164
|
};
|
|
165
|
-
//# sourceMappingURL=chunk-
|
|
165
|
+
//# sourceMappingURL=chunk-2QTYIOJ5.js.map
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
findFirstSymbolMatch,
|
|
3
3
|
getSourceImports,
|
|
4
4
|
resolveIndexedFile
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-OMCRXXDX.js";
|
|
6
6
|
import {
|
|
7
7
|
isModuleLikeSymbol,
|
|
8
8
|
leafName,
|
|
@@ -169,4 +169,4 @@ export {
|
|
|
169
169
|
importedBy,
|
|
170
170
|
unusedImports
|
|
171
171
|
};
|
|
172
|
-
//# sourceMappingURL=chunk-
|
|
172
|
+
//# sourceMappingURL=chunk-3VI4YXCL.js.map
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
isEntrySurface
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-UGS7HJI4.js";
|
|
4
4
|
import {
|
|
5
5
|
getAllDefinitions,
|
|
6
6
|
getCalleeRowsForSymbol,
|
|
7
7
|
getCallerRowsForSymbol
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-OMCRXXDX.js";
|
|
9
9
|
import {
|
|
10
10
|
shortenSymbol
|
|
11
11
|
} from "./chunk-YMSJCSRG.js";
|
|
@@ -31,4 +31,4 @@ function isolated(db, opts = {}) {
|
|
|
31
31
|
export {
|
|
32
32
|
isolated
|
|
33
33
|
};
|
|
34
|
-
//# sourceMappingURL=chunk-
|
|
34
|
+
//# sourceMappingURL=chunk-3VV2G6U7.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
findFirstSymbolMatch,
|
|
3
3
|
getCalleeRowsForSymbol
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-OMCRXXDX.js";
|
|
5
5
|
import {
|
|
6
6
|
shortenSymbol
|
|
7
7
|
} from "./chunk-YMSJCSRG.js";
|
|
@@ -73,4 +73,4 @@ function convergence(db, symbolPatternA, symbolPatternB) {
|
|
|
73
73
|
export {
|
|
74
74
|
convergence
|
|
75
75
|
};
|
|
76
|
-
//# sourceMappingURL=chunk-
|
|
76
|
+
//# sourceMappingURL=chunk-44PFXVXG.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getScopedDefinitions
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-OMCRXXDX.js";
|
|
4
4
|
import {
|
|
5
5
|
shortenSymbol
|
|
6
6
|
} from "./chunk-YMSJCSRG.js";
|
|
@@ -61,4 +61,4 @@ function definitionLoc(definition) {
|
|
|
61
61
|
export {
|
|
62
62
|
staleAbstractions
|
|
63
63
|
};
|
|
64
|
-
//# sourceMappingURL=chunk-
|
|
64
|
+
//# sourceMappingURL=chunk-6SLFQR36.js.map
|
|
@@ -3,37 +3,37 @@ import {
|
|
|
3
3
|
} from "./chunk-74RFWB5T.js";
|
|
4
4
|
import {
|
|
5
5
|
wrapperCandidates
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-VKUUXOE7.js";
|
|
7
7
|
import {
|
|
8
8
|
similarAll
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-QJI7EECA.js";
|
|
10
10
|
import {
|
|
11
11
|
staleAbstractions
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-6SLFQR36.js";
|
|
13
13
|
import {
|
|
14
14
|
isolated
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-3VV2G6U7.js";
|
|
16
16
|
import {
|
|
17
17
|
passthroughCandidates
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-RJ2D6YWQ.js";
|
|
19
19
|
import {
|
|
20
20
|
drift
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-2QTYIOJ5.js";
|
|
22
22
|
import {
|
|
23
23
|
extractCandidates
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-PTMGEBU3.js";
|
|
25
25
|
import {
|
|
26
26
|
complexityHotspots
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-WJZHDUSB.js";
|
|
28
28
|
import {
|
|
29
29
|
cycles
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-2MQ5DPY6.js";
|
|
31
31
|
import {
|
|
32
32
|
dead
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-R5HICGMB.js";
|
|
34
34
|
import {
|
|
35
35
|
isEntrySurface
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-UGS7HJI4.js";
|
|
37
37
|
|
|
38
38
|
// src/queries/health.ts
|
|
39
39
|
function health(db, opts = {}) {
|
|
@@ -218,4 +218,4 @@ function health(db, opts = {}) {
|
|
|
218
218
|
export {
|
|
219
219
|
health
|
|
220
220
|
};
|
|
221
|
-
//# sourceMappingURL=chunk-
|
|
221
|
+
//# sourceMappingURL=chunk-7DBPRGMS.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
findFirstSymbolMatch,
|
|
3
3
|
getCalleeRowsForSymbol
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-OMCRXXDX.js";
|
|
5
5
|
import {
|
|
6
6
|
shortenSymbol
|
|
7
7
|
} from "./chunk-YMSJCSRG.js";
|
|
@@ -107,4 +107,4 @@ function stripCommentsAndStrings(source) {
|
|
|
107
107
|
export {
|
|
108
108
|
complexity
|
|
109
109
|
};
|
|
110
|
-
//# sourceMappingURL=chunk-
|
|
110
|
+
//# sourceMappingURL=chunk-DTB724R3.js.map
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
isLiveBarrel
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-UGS7HJI4.js";
|
|
4
4
|
import {
|
|
5
5
|
getDefinitionsForFile,
|
|
6
6
|
getSourceExports,
|
|
7
7
|
getSourceImports
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-OMCRXXDX.js";
|
|
9
9
|
import {
|
|
10
10
|
leafSuffix,
|
|
11
11
|
shortenSymbol
|
|
@@ -182,4 +182,4 @@ function dedupeReexports(rows) {
|
|
|
182
182
|
export {
|
|
183
183
|
redundantReexports
|
|
184
184
|
};
|
|
185
|
-
//# sourceMappingURL=chunk-
|
|
185
|
+
//# sourceMappingURL=chunk-FLOYI6I4.js.map
|
|
@@ -3,8 +3,15 @@ function cleanSignature(sig) {
|
|
|
3
3
|
if (!sig || !sig.trim()) return null;
|
|
4
4
|
return sig.replace(/^```\w*\s*/, "").replace(/\s*```$/, "").replace(/^\(method\)\s*/, "").replace(/^\(property\)\s*/, "").replace(/^\(function\)\s*/, "").replace(/^\(class\)\s*/, "").replace(/^\(interface\)\s*/, "").replace(/^\(enum\)\s*/, "").replace(/^\(type alias\)\s*/, "").replace(/^\(const\)\s*/, "").replace(/^\(var\)\s*/, "").trim() || null;
|
|
5
5
|
}
|
|
6
|
+
function extractSignature(doc) {
|
|
7
|
+
if (!doc) return null;
|
|
8
|
+
const pipeIdx = doc.indexOf("|");
|
|
9
|
+
if (pipeIdx === -1) return doc.replace(/\n/g, " ");
|
|
10
|
+
return doc.slice(pipeIdx + 1).replace(/\n/g, " ");
|
|
11
|
+
}
|
|
6
12
|
|
|
7
13
|
export {
|
|
8
|
-
cleanSignature
|
|
14
|
+
cleanSignature,
|
|
15
|
+
extractSignature
|
|
9
16
|
};
|
|
10
|
-
//# sourceMappingURL=chunk-
|
|
17
|
+
//# sourceMappingURL=chunk-GJT3MO2T.js.map
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
findFirstSymbolMatch,
|
|
3
3
|
getCalleeRowsForSymbol,
|
|
4
|
+
getResolvedReferenceSites,
|
|
4
5
|
getSourceReferenceSites
|
|
5
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-OMCRXXDX.js";
|
|
6
7
|
import {
|
|
7
8
|
shortenSymbol
|
|
8
9
|
} from "./chunk-YMSJCSRG.js";
|
|
@@ -16,34 +17,12 @@ function dataflow(db, symbolPattern) {
|
|
|
16
17
|
line: match.startLine
|
|
17
18
|
}];
|
|
18
19
|
const sourceUsageSites = getSourceReferenceSites(db, match);
|
|
19
|
-
const
|
|
20
|
+
const resolvedSites = sourceUsageSites.length > 0 ? sourceUsageSites : getResolvedReferenceSites(db, match);
|
|
21
|
+
const normalizedUsageSites = resolvedSites.filter((site) => !db.isIgnored(site.file)).map((site) => ({
|
|
20
22
|
file: site.file,
|
|
21
23
|
line: site.line,
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
`SELECT d.relative_path AS file, c.start_line AS line,
|
|
25
|
-
(SELECT enc_gs.symbol
|
|
26
|
-
FROM defn_enclosing_ranges enc_der
|
|
27
|
-
JOIN global_symbols enc_gs ON enc_der.symbol_id = enc_gs.id
|
|
28
|
-
WHERE enc_der.document_id = d.id
|
|
29
|
-
AND enc_der.start_line <= c.start_line
|
|
30
|
-
AND enc_der.end_line >= c.end_line
|
|
31
|
-
ORDER BY (enc_der.end_line - enc_der.start_line) ASC
|
|
32
|
-
LIMIT 1
|
|
33
|
-
) AS enclosing_symbol
|
|
34
|
-
FROM mentions m
|
|
35
|
-
JOIN chunks c ON m.chunk_id = c.id
|
|
36
|
-
JOIN documents d ON c.document_id = d.id
|
|
37
|
-
WHERE m.symbol_id = ? AND m.role != 1
|
|
38
|
-
${db.pathExclusionsFor("d")}
|
|
39
|
-
ORDER BY d.relative_path, c.start_line`,
|
|
40
|
-
match.symbolId
|
|
41
|
-
);
|
|
42
|
-
const normalizedUsageSites = usageSites.filter((site) => !db.isIgnored(site.file)).map((site) => ({
|
|
43
|
-
file: site.file,
|
|
44
|
-
line: site.line,
|
|
45
|
-
enclosingSymbol: site.enclosing_symbol ?? "(top-level)",
|
|
46
|
-
enclosingShort: site.enclosing_symbol ? shortenSymbol(site.enclosing_symbol) : "(top-level)"
|
|
24
|
+
enclosingSymbol: site.enclosingSymbol ?? "(top-level)",
|
|
25
|
+
enclosingShort: site.enclosingSymbol ? shortenSymbol(site.enclosingSymbol) : "(top-level)"
|
|
47
26
|
}));
|
|
48
27
|
const producers = uniqueSymbolRows(getCalleeRowsForSymbol(db, match, { limit: 30 }).map((row) => ({
|
|
49
28
|
symbol: row.symbol,
|
|
@@ -84,4 +63,4 @@ function uniqueSymbolRows(rows) {
|
|
|
84
63
|
export {
|
|
85
64
|
dataflow
|
|
86
65
|
};
|
|
87
|
-
//# sourceMappingURL=chunk-
|
|
66
|
+
//# sourceMappingURL=chunk-HAP4LJKX.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
buildFileDepGraph
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-OMCRXXDX.js";
|
|
4
4
|
|
|
5
5
|
// src/queries/similar-files.ts
|
|
6
6
|
function similarFiles(db, opts = {}) {
|
|
@@ -90,4 +90,4 @@ function compareProfiles(a, b, minSimilarity) {
|
|
|
90
90
|
export {
|
|
91
91
|
similarFiles
|
|
92
92
|
};
|
|
93
|
-
//# sourceMappingURL=chunk-
|
|
93
|
+
//# sourceMappingURL=chunk-JCOJQ4I6.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getAllDefinitions,
|
|
3
3
|
getCallerRowsForSymbol
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-OMCRXXDX.js";
|
|
5
5
|
import {
|
|
6
6
|
shortenSymbol
|
|
7
7
|
} from "./chunk-YMSJCSRG.js";
|
|
@@ -56,4 +56,4 @@ function hotspots(db, opts = {}) {
|
|
|
56
56
|
export {
|
|
57
57
|
hotspots
|
|
58
58
|
};
|
|
59
|
-
//# sourceMappingURL=chunk-
|
|
59
|
+
//# sourceMappingURL=chunk-JGQMOS4V.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
buildFileDepGraph
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-OMCRXXDX.js";
|
|
4
4
|
|
|
5
5
|
// src/queries/similar-chains.ts
|
|
6
6
|
function similarChains(db, opts = {}) {
|
|
@@ -210,4 +210,4 @@ function isSubChain(sub, full) {
|
|
|
210
210
|
export {
|
|
211
211
|
similarChains
|
|
212
212
|
};
|
|
213
|
-
//# sourceMappingURL=chunk-
|
|
213
|
+
//# sourceMappingURL=chunk-JMD4WJ2Q.js.map
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
|
+
getDefinitionsForFile,
|
|
2
3
|
resolveIndexedFile
|
|
3
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-OMCRXXDX.js";
|
|
4
5
|
import {
|
|
5
6
|
shortenSymbol
|
|
6
7
|
} from "./chunk-YMSJCSRG.js";
|
|
@@ -17,18 +18,10 @@ function changeSurface(db, filePattern) {
|
|
|
17
18
|
resolvedFile
|
|
18
19
|
);
|
|
19
20
|
if (!doc || db.isIgnored(doc.relative_path)) return null;
|
|
20
|
-
const
|
|
21
|
-
`SELECT DISTINCT gs.id AS symbol_id, gs.symbol, der.start_line, der.end_line
|
|
22
|
-
FROM defn_enclosing_ranges der
|
|
23
|
-
JOIN global_symbols gs ON der.symbol_id = gs.id
|
|
24
|
-
WHERE der.document_id = ?
|
|
25
|
-
${db.symbolNoiseFor("gs")}
|
|
26
|
-
ORDER BY der.start_line`,
|
|
27
|
-
doc.id
|
|
28
|
-
);
|
|
21
|
+
const definitions = getDefinitionsForFile(db, doc.relative_path).sort((a, b) => a.startLine - b.startLine || a.endLine - b.endLine);
|
|
29
22
|
const symbols = [];
|
|
30
23
|
let totalExternalConsumers = 0;
|
|
31
|
-
for (const
|
|
24
|
+
for (const def of definitions) {
|
|
32
25
|
const consumerRow = db.get(
|
|
33
26
|
`SELECT COUNT(DISTINCT c.document_id) AS consumer_count
|
|
34
27
|
FROM mentions m
|
|
@@ -36,7 +29,7 @@ function changeSurface(db, filePattern) {
|
|
|
36
29
|
WHERE m.symbol_id = ?
|
|
37
30
|
AND m.role != 1
|
|
38
31
|
AND c.document_id != ?`,
|
|
39
|
-
|
|
32
|
+
def.symbolId,
|
|
40
33
|
doc.id
|
|
41
34
|
);
|
|
42
35
|
const externalConsumers = consumerRow?.consumer_count ?? 0;
|
|
@@ -50,10 +43,10 @@ function changeSurface(db, filePattern) {
|
|
|
50
43
|
}
|
|
51
44
|
totalExternalConsumers += externalConsumers;
|
|
52
45
|
symbols.push({
|
|
53
|
-
symbol:
|
|
54
|
-
shortName: shortenSymbol(
|
|
55
|
-
startLine:
|
|
56
|
-
endLine:
|
|
46
|
+
symbol: def.symbol,
|
|
47
|
+
shortName: shortenSymbol(def.symbol),
|
|
48
|
+
startLine: def.startLine,
|
|
49
|
+
endLine: def.endLine,
|
|
57
50
|
externalConsumers,
|
|
58
51
|
riskLevel
|
|
59
52
|
});
|
|
@@ -68,4 +61,4 @@ function changeSurface(db, filePattern) {
|
|
|
68
61
|
export {
|
|
69
62
|
changeSurface
|
|
70
63
|
};
|
|
71
|
-
//# sourceMappingURL=chunk-
|
|
64
|
+
//# sourceMappingURL=chunk-JSQPZOPO.js.map
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
|
+
getDefinitionsForFile,
|
|
2
3
|
resolveIndexedPaths
|
|
3
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-OMCRXXDX.js";
|
|
4
5
|
import {
|
|
5
6
|
shortenSymbol
|
|
6
7
|
} from "./chunk-YMSJCSRG.js";
|
|
@@ -11,32 +12,24 @@ function outline(db, filePattern) {
|
|
|
11
12
|
if (resolvedPaths.length === 0) {
|
|
12
13
|
return [];
|
|
13
14
|
}
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
`SELECT gs.symbol, gs.enclosing_symbol, der.start_line, der.end_line
|
|
17
|
-
FROM defn_enclosing_ranges der
|
|
18
|
-
JOIN global_symbols gs ON der.symbol_id = gs.id
|
|
19
|
-
JOIN documents d ON der.document_id = d.id
|
|
20
|
-
WHERE d.relative_path IN (${placeholders})
|
|
21
|
-
${db.symbolNoise}
|
|
22
|
-
ORDER BY d.relative_path, der.start_line`,
|
|
23
|
-
...resolvedPaths
|
|
15
|
+
const definitions = resolvedPaths.flatMap((relativePath) => getDefinitionsForFile(db, relativePath)).filter((d) => !db.isIgnored(d.relativePath)).sort(
|
|
16
|
+
(a, b) => a.relativePath.localeCompare(b.relativePath) || a.startLine - b.startLine || a.endLine - b.endLine
|
|
24
17
|
);
|
|
25
|
-
const nodes =
|
|
26
|
-
symbol:
|
|
27
|
-
shortName: shortenSymbol(
|
|
28
|
-
startLine:
|
|
29
|
-
endLine:
|
|
18
|
+
const nodes = definitions.map((d) => ({
|
|
19
|
+
symbol: d.symbol,
|
|
20
|
+
shortName: shortenSymbol(d.symbol),
|
|
21
|
+
startLine: d.startLine,
|
|
22
|
+
endLine: d.endLine,
|
|
30
23
|
children: []
|
|
31
24
|
}));
|
|
32
25
|
const nodeMap = /* @__PURE__ */ new Map();
|
|
33
26
|
for (const n of nodes) nodeMap.set(n.symbol, n);
|
|
34
27
|
const roots = [];
|
|
35
|
-
for (let i = 0; i <
|
|
36
|
-
const
|
|
28
|
+
for (let i = 0; i < definitions.length; i++) {
|
|
29
|
+
const d = definitions[i];
|
|
37
30
|
const node = nodes[i];
|
|
38
|
-
if (
|
|
39
|
-
nodeMap.get(
|
|
31
|
+
if (d.enclosingSymbol && nodeMap.has(d.enclosingSymbol)) {
|
|
32
|
+
nodeMap.get(d.enclosingSymbol).children.push(node);
|
|
40
33
|
continue;
|
|
41
34
|
}
|
|
42
35
|
let bestParent = null;
|
|
@@ -63,4 +56,4 @@ function outline(db, filePattern) {
|
|
|
63
56
|
export {
|
|
64
57
|
outline
|
|
65
58
|
};
|
|
66
|
-
//# sourceMappingURL=chunk-
|
|
59
|
+
//# sourceMappingURL=chunk-JZN3DRCT.js.map
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
|
-
cleanSignature
|
|
3
|
-
|
|
2
|
+
cleanSignature,
|
|
3
|
+
extractSignature
|
|
4
|
+
} from "./chunk-GJT3MO2T.js";
|
|
4
5
|
import {
|
|
5
6
|
findFirstSymbolMatch,
|
|
7
|
+
getResolvedReferenceSites,
|
|
6
8
|
getSourceReferenceSites,
|
|
7
9
|
getSourceText
|
|
8
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-OMCRXXDX.js";
|
|
9
11
|
import {
|
|
10
12
|
isFunctionLikeSymbol,
|
|
11
13
|
shortenSymbol
|
|
@@ -18,50 +20,24 @@ function trace(db, symbolPattern) {
|
|
|
18
20
|
return { definitions: [], referencedBy: [] };
|
|
19
21
|
}
|
|
20
22
|
const definitionMeta = db.get(
|
|
21
|
-
|
|
22
|
-
gs.display_name,
|
|
23
|
-
REPLACE(SUBSTR(gs.documentation, INSTR(gs.documentation, '|') + 1), char(10), ' ') AS sig
|
|
24
|
-
FROM global_symbols gs
|
|
25
|
-
WHERE gs.id = ?
|
|
26
|
-
LIMIT 10`,
|
|
23
|
+
"SELECT display_name, documentation FROM global_symbols WHERE id = ?",
|
|
27
24
|
match.symbolId
|
|
28
25
|
);
|
|
26
|
+
const sig = extractSignature(definitionMeta?.documentation ?? null);
|
|
29
27
|
const definitions = db.isIgnored(match.relativePath) ? [] : [{
|
|
30
28
|
relativePath: match.relativePath,
|
|
31
29
|
startLine: match.startLine,
|
|
32
30
|
endLine: match.endLine,
|
|
33
|
-
signature: buildTraceSignature(
|
|
31
|
+
signature: buildTraceSignature(sig, definitionMeta?.display_name ?? null, match.symbol),
|
|
34
32
|
source: definitionSource(db, match.relativePath, match.startLine, match.endLine)
|
|
35
33
|
}];
|
|
36
34
|
const sourceSites = getSourceReferenceSites(db, match);
|
|
37
|
-
const
|
|
35
|
+
const resolvedSites = sourceSites.length > 0 ? sourceSites : getResolvedReferenceSites(db, match);
|
|
36
|
+
const referencedBy = resolvedSites.filter((site) => !db.isIgnored(site.file)).map((site) => ({
|
|
38
37
|
relativePath: site.file,
|
|
39
38
|
line: site.line,
|
|
40
39
|
enclosingSymbol: site.enclosingSymbol,
|
|
41
40
|
enclosingShort: site.enclosingSymbol ? shortenSymbol(site.enclosingSymbol) : "(top-level)"
|
|
42
|
-
})) : db.all(
|
|
43
|
-
`SELECT DISTINCT d.relative_path, c.start_line AS line,
|
|
44
|
-
(SELECT enc_gs.symbol
|
|
45
|
-
FROM defn_enclosing_ranges enc_der
|
|
46
|
-
JOIN global_symbols enc_gs ON enc_der.symbol_id = enc_gs.id
|
|
47
|
-
WHERE enc_der.document_id = d.id
|
|
48
|
-
AND enc_der.start_line <= c.start_line
|
|
49
|
-
AND enc_der.end_line >= c.end_line
|
|
50
|
-
ORDER BY (enc_der.end_line - enc_der.start_line) ASC
|
|
51
|
-
LIMIT 1
|
|
52
|
-
) AS enclosing_symbol
|
|
53
|
-
FROM mentions m
|
|
54
|
-
JOIN chunks c ON m.chunk_id = c.id
|
|
55
|
-
JOIN documents d ON c.document_id = d.id
|
|
56
|
-
WHERE m.symbol_id = ?
|
|
57
|
-
AND m.role != 1
|
|
58
|
-
ORDER BY d.relative_path, c.start_line`,
|
|
59
|
-
match.symbolId
|
|
60
|
-
).filter((r) => !db.isIgnored(r.relative_path)).map((r) => ({
|
|
61
|
-
relativePath: r.relative_path,
|
|
62
|
-
line: r.line,
|
|
63
|
-
enclosingSymbol: r.enclosing_symbol,
|
|
64
|
-
enclosingShort: r.enclosing_symbol ? shortenSymbol(r.enclosing_symbol) : "(top-level)"
|
|
65
41
|
}));
|
|
66
42
|
return { definitions, referencedBy };
|
|
67
43
|
}
|
|
@@ -92,4 +68,4 @@ function looksBogusSignature(signature) {
|
|
|
92
68
|
export {
|
|
93
69
|
trace
|
|
94
70
|
};
|
|
95
|
-
//# sourceMappingURL=chunk-
|
|
71
|
+
//# sourceMappingURL=chunk-KMWYB3CX.js.map
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
|
-
cleanSignature
|
|
3
|
-
|
|
2
|
+
cleanSignature,
|
|
3
|
+
extractSignature
|
|
4
|
+
} from "./chunk-GJT3MO2T.js";
|
|
4
5
|
import {
|
|
5
6
|
getDefinitionsForFile,
|
|
6
7
|
resolveIndexedPaths
|
|
7
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-OMCRXXDX.js";
|
|
8
9
|
import {
|
|
9
10
|
shortenSymbol
|
|
10
11
|
} from "./chunk-YMSJCSRG.js";
|
|
@@ -17,9 +18,7 @@ function symbols(db, filePattern) {
|
|
|
17
18
|
}
|
|
18
19
|
return resolvedPaths.flatMap((relativePath) => getDefinitionsForFile(db, relativePath)).filter((row) => !db.isIgnored(row.relativePath)).map((row) => {
|
|
19
20
|
const docRow = db.get(
|
|
20
|
-
|
|
21
|
-
FROM global_symbols
|
|
22
|
-
WHERE id = ?`,
|
|
21
|
+
"SELECT documentation FROM global_symbols WHERE id = ?",
|
|
23
22
|
row.symbolId
|
|
24
23
|
);
|
|
25
24
|
return {
|
|
@@ -27,7 +26,7 @@ function symbols(db, filePattern) {
|
|
|
27
26
|
endLine: row.endLine,
|
|
28
27
|
symbol: row.symbol,
|
|
29
28
|
shortName: shortenSymbol(row.symbol),
|
|
30
|
-
signature: cleanSignature(docRow?.
|
|
29
|
+
signature: cleanSignature(extractSignature(docRow?.documentation ?? null))
|
|
31
30
|
};
|
|
32
31
|
});
|
|
33
32
|
}
|
|
@@ -35,4 +34,4 @@ function symbols(db, filePattern) {
|
|
|
35
34
|
export {
|
|
36
35
|
symbols
|
|
37
36
|
};
|
|
38
|
-
//# sourceMappingURL=chunk-
|
|
37
|
+
//# sourceMappingURL=chunk-MRM755FU.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
findFirstSymbolMatch
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-OMCRXXDX.js";
|
|
4
4
|
import {
|
|
5
5
|
parseSymbol,
|
|
6
6
|
shortenSymbol
|
|
@@ -66,4 +66,4 @@ function hierarchy(db, symbolPattern) {
|
|
|
66
66
|
export {
|
|
67
67
|
hierarchy
|
|
68
68
|
};
|
|
69
|
-
//# sourceMappingURL=chunk-
|
|
69
|
+
//# sourceMappingURL=chunk-N2XO3Z5F.js.map
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
|
-
cleanSignature
|
|
3
|
-
|
|
2
|
+
cleanSignature,
|
|
3
|
+
extractSignature
|
|
4
|
+
} from "./chunk-GJT3MO2T.js";
|
|
4
5
|
import {
|
|
6
|
+
getDefinitionsForFile,
|
|
5
7
|
resolveIndexedPaths
|
|
6
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-OMCRXXDX.js";
|
|
7
9
|
import {
|
|
8
10
|
shortenSymbol
|
|
9
11
|
} from "./chunk-YMSJCSRG.js";
|
|
@@ -22,26 +24,18 @@ function system(db, modulePattern) {
|
|
|
22
24
|
...matchedPaths
|
|
23
25
|
);
|
|
24
26
|
const files = fileRows.map((r) => r.relative_path).filter((p) => !db.isIgnored(p));
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
);
|
|
38
|
-
const symbols = symbolRows.map((r) => ({
|
|
39
|
-
startLine: r.start_line,
|
|
40
|
-
endLine: r.end_line,
|
|
41
|
-
symbol: r.symbol,
|
|
42
|
-
shortName: shortenSymbol(r.symbol),
|
|
43
|
-
signature: cleanSignature(r.sig)
|
|
44
|
-
}));
|
|
27
|
+
const symbols = files.flatMap((relativePath) => getDefinitionsForFile(db, relativePath)).filter((d) => d.documentation !== null && d.documentation !== "").sort(
|
|
28
|
+
(a, b) => a.relativePath.localeCompare(b.relativePath) || a.startLine - b.startLine || a.endLine - b.endLine
|
|
29
|
+
).map((d) => {
|
|
30
|
+
const sig = extractSignature(d.documentation);
|
|
31
|
+
return {
|
|
32
|
+
startLine: d.startLine,
|
|
33
|
+
endLine: d.endLine,
|
|
34
|
+
symbol: d.symbol,
|
|
35
|
+
shortName: shortenSymbol(d.symbol),
|
|
36
|
+
signature: cleanSignature(sig)
|
|
37
|
+
};
|
|
38
|
+
});
|
|
45
39
|
const depRows = db.all(
|
|
46
40
|
`SELECT DISTINCT d2.relative_path
|
|
47
41
|
FROM mentions m
|
|
@@ -79,4 +73,4 @@ function system(db, modulePattern) {
|
|
|
79
73
|
export {
|
|
80
74
|
system
|
|
81
75
|
};
|
|
82
|
-
//# sourceMappingURL=chunk-
|
|
76
|
+
//# sourceMappingURL=chunk-OLW5UL36.js.map
|