scip-query 0.6.7 → 0.7.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 +3 -1
- package/dist/augment-vue-worker.js +1 -1
- package/dist/chunk-23YIGCYF.js +25 -0
- package/dist/{chunk-KQWFRAQI.js → chunk-2IYEIFPP.js} +6 -6
- package/dist/chunk-2JEFS2YJ.js +2 -0
- package/dist/chunk-33SSUPCB.js +7 -0
- package/dist/chunk-3GNFUVFA.js +2 -0
- package/dist/{chunk-ZNNCDAYX.js → chunk-3OUC276S.js} +2 -2
- package/dist/{chunk-PQTGBYXV.js → chunk-4STLJYHI.js} +4 -4
- package/dist/chunk-563HLCDW.js +35 -0
- package/dist/chunk-5TT47UMX.js +44 -0
- package/dist/chunk-6H2XIIPY.js +71 -0
- package/dist/{chunk-HTJ5BOYP.js → chunk-72JOIFXL.js} +3 -3
- package/dist/chunk-7H4RJ4MC.js +2 -0
- package/dist/chunk-7O4MJYIW.js +63 -0
- package/dist/chunk-7OX2O53H.js +62 -0
- package/dist/chunk-A2AVLALL.js +2 -0
- package/dist/chunk-AQYBOORI.js +2 -0
- package/dist/chunk-ARBZM2NF.js +34 -0
- package/dist/{chunk-2CC7RA6B.js → chunk-BI4F6GXI.js} +2 -2
- package/dist/chunk-BOVNTAKQ.js +3 -0
- package/dist/chunk-CKIO6SVS.js +2 -0
- package/dist/chunk-D6Z67MZL.js +2 -0
- package/dist/chunk-DFK54IRN.js +2 -0
- package/dist/chunk-FD37DBTD.js +2 -0
- package/dist/chunk-FOQQDXE7.js +2 -0
- package/dist/chunk-GAQGJ52J.js +11 -0
- package/dist/chunk-IODTPF5H.js +20 -0
- package/dist/chunk-J6Z5YKGQ.js +4 -0
- package/dist/chunk-JB4PUN5S.js +40 -0
- package/dist/chunk-JTXKS5GK.js +3 -0
- package/dist/chunk-KJ3ZJIE5.js +2 -0
- package/dist/chunk-KJ6CW6EK.js +2 -0
- package/dist/{chunk-2R7OKZE5.js → chunk-KNA6Z7JB.js} +3 -3
- package/dist/{chunk-FYO3FPFH.js → chunk-LDV2B7ET.js} +8 -8
- package/dist/chunk-LWYIGRHR.js +5 -0
- package/dist/chunk-MDAYGS6T.js +2 -0
- package/dist/chunk-MX6F756F.js +2 -0
- package/dist/chunk-NHDPYW7O.js +2 -0
- package/dist/{chunk-TYRPQE6R.js → chunk-NKJKI6SE.js} +2 -2
- package/dist/chunk-NN3O7TPH.js +8 -0
- package/dist/chunk-NSTZMBAB.js +18 -0
- package/dist/chunk-NYEMZHUC.js +6 -0
- package/dist/chunk-OHEIZWIA.js +4 -0
- package/dist/chunk-PG3ZI5IH.js +2 -0
- package/dist/chunk-QAEDNTY7.js +2 -0
- package/dist/chunk-QE6MGGUY.js +2 -0
- package/dist/chunk-QPRIYXH4.js +2 -0
- package/dist/chunk-QWJBIBE6.js +3 -0
- package/dist/chunk-RCJEFQOK.js +4 -0
- package/dist/chunk-ROOHENEP.js +61 -0
- package/dist/{chunk-2YA36CXK.js → chunk-ROZNBWIF.js} +2 -2
- package/dist/chunk-TGK5DFBJ.js +2 -0
- package/dist/chunk-TKDJQ2WD.js +59 -0
- package/dist/chunk-TRNAQABL.js +7 -0
- package/dist/chunk-U75WH4XG.js +2 -0
- package/dist/chunk-V53J46BX.js +2 -0
- package/dist/chunk-V76FCF5F.js +2 -0
- package/dist/chunk-VUBQBW7H.js +16 -0
- package/dist/chunk-WJQY2LGT.js +2 -0
- package/dist/{chunk-ILQSK2KJ.js → chunk-WODJHE6Z.js} +3 -3
- package/dist/{chunk-RRWPHKZA.js → chunk-WPLKHAH7.js} +4 -4
- package/dist/chunk-XO6R3X5J.js +2 -0
- package/dist/chunk-YSZNAG4G.js +2 -0
- package/dist/chunk-ZNUPGRPR.js +3 -0
- package/dist/{chunk-OCQN6WF4.js → chunk-ZXFTC5ET.js} +4 -4
- package/dist/cli.js +361 -505
- package/dist/config-types-CGIeLEpY.d.ts +108 -0
- package/dist/db-DdTPetj5.d.ts +69 -0
- package/dist/health-x7B4Xu_6.d.ts +119 -0
- package/dist/index.d.ts +109 -336
- package/dist/index.js +3 -131
- package/dist/postinstall.js +1 -1
- package/dist/queries/affected.d.ts +9 -2
- package/dist/queries/affected.js +1 -1
- package/dist/queries/bottlenecks.d.ts +14 -2
- package/dist/queries/bottlenecks.js +1 -1
- package/dist/queries/by-kind.d.ts +12 -2
- package/dist/queries/by-kind.js +1 -1
- package/dist/queries/call-graph.d.ts +22 -3
- package/dist/queries/call-graph.js +1 -1
- package/dist/queries/change-surface.d.ts +19 -3
- package/dist/queries/change-surface.js +1 -1
- package/dist/queries/code.d.ts +12 -2
- package/dist/queries/code.js +1 -1
- package/dist/queries/complexity-hotspots.d.ts +16 -2
- package/dist/queries/complexity-hotspots.js +1 -1
- package/dist/queries/complexity.d.ts +22 -3
- package/dist/queries/complexity.js +1 -1
- package/dist/queries/convergence.d.ts +25 -3
- package/dist/queries/convergence.js +1 -1
- package/dist/queries/coupling.d.ts +8 -2
- package/dist/queries/coupling.js +1 -1
- package/dist/queries/cycles.d.ts +16 -2
- package/dist/queries/cycles.js +1 -1
- package/dist/queries/dataflow.d.ts +35 -3
- package/dist/queries/dataflow.js +1 -1
- package/dist/queries/dead.d.ts +34 -2
- package/dist/queries/dead.js +1 -1
- package/dist/queries/deep-chains.d.ts +8 -2
- package/dist/queries/deep-chains.js +1 -1
- package/dist/queries/deps.d.ts +6 -2
- package/dist/queries/deps.js +1 -1
- package/dist/queries/diff-impact.d.ts +22 -2
- package/dist/queries/diff-impact.js +1 -1
- package/dist/queries/drift.d.ts +19 -2
- package/dist/queries/drift.js +1 -1
- package/dist/queries/extract-candidates.d.ts +20 -2
- package/dist/queries/extract-candidates.js +1 -1
- package/dist/queries/fan.d.ts +7 -2
- package/dist/queries/fan.js +1 -1
- package/dist/queries/files.d.ts +6 -2
- package/dist/queries/files.js +1 -1
- package/dist/queries/health.d.ts +4 -81
- package/dist/queries/health.js +1 -1
- package/dist/queries/hierarchy.d.ts +8 -2
- package/dist/queries/hierarchy.js +1 -1
- package/dist/queries/hotspots.d.ts +10 -2
- package/dist/queries/hotspots.js +1 -1
- package/dist/queries/imports.d.ts +19 -4
- package/dist/queries/imports.js +1 -1
- package/dist/queries/index.d.ts +45 -44
- package/dist/queries/index.js +1 -1
- package/dist/queries/isolated.d.ts +13 -2
- package/dist/queries/isolated.js +1 -1
- package/dist/queries/members.d.ts +10 -2
- package/dist/queries/members.js +1 -1
- package/dist/queries/methods.d.ts +8 -2
- package/dist/queries/methods.js +1 -1
- package/dist/queries/outline.d.ts +10 -2
- package/dist/queries/outline.js +1 -1
- package/dist/queries/passthrough-candidates.d.ts +15 -2
- package/dist/queries/passthrough-candidates.js +1 -1
- package/dist/queries/redundant-reexports.d.ts +13 -2
- package/dist/queries/redundant-reexports.js +1 -1
- package/dist/queries/refs.d.ts +10 -3
- package/dist/queries/refs.js +1 -1
- package/dist/queries/similar-chains.d.ts +21 -2
- package/dist/queries/similar-chains.js +1 -1
- package/dist/queries/similar-files.d.ts +12 -2
- package/dist/queries/similar-files.js +1 -1
- package/dist/queries/similar-signatures.d.ts +18 -2
- package/dist/queries/similar-signatures.js +1 -1
- package/dist/queries/similar.d.ts +24 -2
- package/dist/queries/similar.js +1 -1
- package/dist/queries/slice.d.ts +17 -2
- package/dist/queries/slice.js +1 -1
- package/dist/queries/stale-abstractions.d.ts +37 -3
- package/dist/queries/stale-abstractions.js +1 -1
- package/dist/queries/stats.d.ts +11 -2
- package/dist/queries/stats.js +1 -1
- package/dist/queries/surface.d.ts +8 -2
- package/dist/queries/surface.js +1 -1
- package/dist/queries/symbols.d.ts +10 -2
- package/dist/queries/symbols.js +1 -1
- package/dist/queries/system.d.ts +10 -2
- package/dist/queries/system.js +1 -1
- package/dist/queries/trace.d.ts +21 -3
- package/dist/queries/trace.js +1 -1
- package/dist/queries/wrapper-candidates.d.ts +15 -2
- package/dist/queries/wrapper-candidates.js +1 -1
- package/dist/reindex-worker.js +10 -10
- package/dist/reindex.d.ts +153 -0
- package/dist/reindex.js +69 -0
- package/dist/runtime.d.ts +108 -0
- package/dist/runtime.js +3 -0
- package/dist/scip-cli-a-xOztiK.d.ts +20 -0
- package/package.json +184 -4
- package/dist/chunk-2AUZ3PLO.js +0 -2
- package/dist/chunk-3A2M7AF3.js +0 -4
- package/dist/chunk-3EJRPTTB.js +0 -2
- package/dist/chunk-3SWWYJPB.js +0 -6
- package/dist/chunk-4M4FEWBL.js +0 -7
- package/dist/chunk-4Y6KUJDO.js +0 -39
- package/dist/chunk-55ZJ2FCW.js +0 -6
- package/dist/chunk-6FLGPRBR.js +0 -5
- package/dist/chunk-6XRB6ATD.js +0 -16
- package/dist/chunk-7EQ4J66C.js +0 -2
- package/dist/chunk-7TGEXAN5.js +0 -25
- package/dist/chunk-ABLXPGAZ.js +0 -2
- package/dist/chunk-BG7YU4DJ.js +0 -2
- package/dist/chunk-D2R6IIEO.js +0 -2
- package/dist/chunk-E47WMJ5F.js +0 -2
- package/dist/chunk-EEA3R37V.js +0 -11
- package/dist/chunk-FAN2CVZT.js +0 -2
- package/dist/chunk-FVH3Y44U.js +0 -1
- package/dist/chunk-G47V5V3U.js +0 -90
- package/dist/chunk-GS55K4WJ.js +0 -85
- package/dist/chunk-H4DXD2FB.js +0 -5
- package/dist/chunk-HADDFTMU.js +0 -2
- package/dist/chunk-IARIBTCL.js +0 -2
- package/dist/chunk-IBWYWAWE.js +0 -70
- package/dist/chunk-JVMXNDRU.js +0 -2
- package/dist/chunk-K345WFTU.js +0 -2
- package/dist/chunk-K6ULLR7M.js +0 -19
- package/dist/chunk-KAM4C6ZD.js +0 -4
- package/dist/chunk-KCC3GMCX.js +0 -2
- package/dist/chunk-KRVRD6KZ.js +0 -5
- package/dist/chunk-KYGNCIJ6.js +0 -84
- package/dist/chunk-LHLXHH43.js +0 -2
- package/dist/chunk-LJ2YWNQF.js +0 -2
- package/dist/chunk-M7GBLQG4.js +0 -7
- package/dist/chunk-MEVK6R7N.js +0 -2
- package/dist/chunk-QRYEOK3M.js +0 -2
- package/dist/chunk-QYWGC7JV.js +0 -114
- package/dist/chunk-R373SHXM.js +0 -2
- package/dist/chunk-RUAJV3TN.js +0 -2
- package/dist/chunk-S57GUI2T.js +0 -7
- package/dist/chunk-SVUVC5VS.js +0 -2
- package/dist/chunk-T426XELO.js +0 -12
- package/dist/chunk-TBJDUS4E.js +0 -71
- package/dist/chunk-TX7BHRMT.js +0 -2
- package/dist/chunk-WPY46NIL.js +0 -5
- package/dist/chunk-X3Z4KZNX.js +0 -2
- package/dist/db-DdlToIC-.d.ts +0 -835
- package/dist/queries/drift-policy.d.ts +0 -6
- package/dist/queries/drift-policy.js +0 -2
- package/dist/queries/health-cache-control.d.ts +0 -15
- package/dist/queries/health-cache-control.js +0 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,51 +1,73 @@
|
|
|
1
|
-
import { S as ScipDatabase
|
|
2
|
-
export {
|
|
3
|
-
export {
|
|
4
|
-
export { files } from './queries/files.js';
|
|
5
|
-
export { symbols } from './queries/symbols.js';
|
|
6
|
-
export { methods } from './queries/methods.js';
|
|
7
|
-
export { refs } from './queries/refs.js';
|
|
8
|
-
export { trace } from './queries/trace.js';
|
|
9
|
-
export { deps, rdeps } from './queries/deps.js';
|
|
10
|
-
export { system } from './queries/system.js';
|
|
11
|
-
export { surface } from './queries/surface.js';
|
|
12
|
-
export { dead } from './queries/dead.js';
|
|
13
|
-
export { hotspots } from './queries/hotspots.js';
|
|
14
|
-
export { importedBy, imports, unusedImports } from './queries/imports.js';
|
|
15
|
-
export { outline } from './queries/outline.js';
|
|
16
|
-
export { members } from './queries/members.js';
|
|
17
|
-
export { fanIn, fanOut, topFanIn, topFanOut } from './queries/fan.js';
|
|
18
|
-
export { coupling, topCoupling } from './queries/coupling.js';
|
|
19
|
-
export { cycles } from './queries/cycles.js';
|
|
20
|
-
export { bottlenecks } from './queries/bottlenecks.js';
|
|
21
|
-
export { isolated } from './queries/isolated.js';
|
|
22
|
-
export { byKind, kindCounts } from './queries/by-kind.js';
|
|
23
|
-
export { deepChains } from './queries/deep-chains.js';
|
|
24
|
-
export { hierarchy } from './queries/hierarchy.js';
|
|
25
|
-
export { callGraph } from './queries/call-graph.js';
|
|
26
|
-
export { similar, similarAll } from './queries/similar.js';
|
|
27
|
-
export { similarFiles } from './queries/similar-files.js';
|
|
28
|
-
export { similarChains } from './queries/similar-chains.js';
|
|
29
|
-
export { extractCandidates } from './queries/extract-candidates.js';
|
|
30
|
-
export { affected } from './queries/affected.js';
|
|
31
|
-
export { changeSurface } from './queries/change-surface.js';
|
|
32
|
-
export { diffImpact, diffImpactPartial, diffImpactPlan, mergeDiffImpactPartials } from './queries/diff-impact.js';
|
|
33
|
-
export { drift } from './queries/drift.js';
|
|
34
|
-
export { wrapperCandidates } from './queries/wrapper-candidates.js';
|
|
35
|
-
export { passthroughCandidates } from './queries/passthrough-candidates.js';
|
|
36
|
-
export { staleAbstractions } from './queries/stale-abstractions.js';
|
|
37
|
-
export { complexityHotspots } from './queries/complexity-hotspots.js';
|
|
38
|
-
export { HEALTH_PHASES, health, healthPhase, healthReportFromPhases } from './queries/health.js';
|
|
39
|
-
export { convergence } from './queries/convergence.js';
|
|
40
|
-
export { code } from './queries/code.js';
|
|
41
|
-
export { complexity } from './queries/complexity.js';
|
|
42
|
-
export { dataflow } from './queries/dataflow.js';
|
|
43
|
-
export { slice } from './queries/slice.js';
|
|
44
|
-
export { redundantReexports } from './queries/redundant-reexports.js';
|
|
45
|
-
export { similarSignatures } from './queries/similar-signatures.js';
|
|
46
|
-
import { Index } from '@c4312/scip';
|
|
1
|
+
import { S as ScipDatabase } from './db-DdTPetj5.js';
|
|
2
|
+
export { c as createGitignoreFilter } from './db-DdTPetj5.js';
|
|
3
|
+
export { S as ScipQueryConfig } from './config-types-CGIeLEpY.js';
|
|
47
4
|
import 'better-sqlite3';
|
|
48
5
|
|
|
6
|
+
/**
|
|
7
|
+
* A symbol's location in the SCIP index. The minimum data needed to
|
|
8
|
+
* identify a definition: which document it lives in, which lines it
|
|
9
|
+
* spans, and the global symbol id. Used as a lightweight handle when
|
|
10
|
+
* the caller doesn't need the symbol's textual name or path.
|
|
11
|
+
*/
|
|
12
|
+
interface SymbolLocation {
|
|
13
|
+
documentId: number;
|
|
14
|
+
startLine: number;
|
|
15
|
+
endLine: number;
|
|
16
|
+
symbolId: number;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* A SymbolLocation plus the human-readable bits: the SCIP symbol string
|
|
20
|
+
* and the document's relative path. Returned by lookup helpers like
|
|
21
|
+
* `findFirstSymbolMatch` so callers don't have to round-trip through the
|
|
22
|
+
* documents table to get a path or symbol name.
|
|
23
|
+
*/
|
|
24
|
+
interface SymbolMatch extends SymbolLocation {
|
|
25
|
+
symbol: string;
|
|
26
|
+
relativePath: string;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* A full definition record: SymbolMatch plus per-symbol metadata
|
|
30
|
+
* (leaf name, parent type, kind, documentation, enclosing symbol).
|
|
31
|
+
* Used by the catalog APIs (`getDefinitionsForFile`, `getAllDefinitions`,
|
|
32
|
+
* `getScopedDefinitions`) so consumers don't have to re-derive any of
|
|
33
|
+
* these per-record.
|
|
34
|
+
*/
|
|
35
|
+
interface IndexedDefinition extends SymbolMatch {
|
|
36
|
+
leaf: string;
|
|
37
|
+
parentTypeName: string | null;
|
|
38
|
+
isFunctionLike: boolean;
|
|
39
|
+
isTypeLike: boolean;
|
|
40
|
+
kind: number | null;
|
|
41
|
+
documentation: string | null;
|
|
42
|
+
enclosingSymbol: string | null;
|
|
43
|
+
}
|
|
44
|
+
/** Parsed components of a SCIP symbol string */
|
|
45
|
+
interface ScipSymbol {
|
|
46
|
+
/** The indexer scheme (e.g. "scip-typescript", "scip-java", "rust-analyzer") */
|
|
47
|
+
scheme: string;
|
|
48
|
+
/** Package manager (e.g. "npm", "maven", "cargo") */
|
|
49
|
+
manager: string;
|
|
50
|
+
/** Package name (e.g. "@vega/api", "com.example/mylib") */
|
|
51
|
+
packageName: string;
|
|
52
|
+
/** Package version */
|
|
53
|
+
version: string;
|
|
54
|
+
/** Descriptor chain — the path to the symbol within the file */
|
|
55
|
+
descriptors: ScipDescriptor[];
|
|
56
|
+
/** The raw, unparsed symbol string */
|
|
57
|
+
raw: string;
|
|
58
|
+
}
|
|
59
|
+
interface ScipDescriptor {
|
|
60
|
+
name: string;
|
|
61
|
+
suffix: DescriptorSuffix;
|
|
62
|
+
}
|
|
63
|
+
type DescriptorSuffix = 'namespace' | 'type' | 'term' | 'method' | 'type-param' | 'parameter' | 'meta' | 'macro';
|
|
64
|
+
/** A local symbol (file-scoped, no cross-file identity) */
|
|
65
|
+
interface ScipLocalSymbol {
|
|
66
|
+
kind: 'local';
|
|
67
|
+
id: string;
|
|
68
|
+
raw: string;
|
|
69
|
+
}
|
|
70
|
+
|
|
49
71
|
/**
|
|
50
72
|
* File classifier — one place to decide what role a source file plays.
|
|
51
73
|
*
|
|
@@ -67,48 +89,13 @@ type FileKind = 'entry' | 'barrel' | 'worker' | 'test' | 'source';
|
|
|
67
89
|
*/
|
|
68
90
|
declare function classifyFile(file: string): FileKind;
|
|
69
91
|
|
|
70
|
-
|
|
71
|
-
* reference-graph — bulk caller/callee maps and reference-site
|
|
72
|
-
* resolution.
|
|
73
|
-
*
|
|
74
|
-
* Where to get what:
|
|
75
|
-
* Reference lines (where is this used?):
|
|
76
|
-
* - Primary: `getSourceReferenceSites` — cross-file identifier
|
|
77
|
-
* scan (re-exported from identifier-attribution).
|
|
78
|
-
* Returns [] when the leaf name is ambiguous.
|
|
79
|
-
* - Fallback: `getResolvedReferenceSites` — mention-resolved
|
|
80
|
-
* chunks with in-chunk line refinement. Always
|
|
81
|
-
* returns a result when the symbol has mentions.
|
|
82
|
-
* Do NOT read `chunks.start_line` as the "line of a reference"; a
|
|
83
|
-
* chunk spans many source lines.
|
|
84
|
-
*
|
|
85
|
-
* Bulk graph builders:
|
|
86
|
-
* - `buildCalleeMap(db, defs)` — for each definition, the symbols
|
|
87
|
-
* it calls (AST + chunk merged).
|
|
88
|
-
* - `buildCrossFileCallerMap(db, defs?)` — reverse: symbolId →
|
|
89
|
-
* set of files that reference it.
|
|
90
|
-
* - `buildCallerRowsMap(db)` — symbolId → list of caller
|
|
91
|
-
* (symbol, file) rows, cached once per DB.
|
|
92
|
-
* - `getCalleeRowsForSymbol` / `getCallerRowsForSymbol` — narrow
|
|
93
|
-
* single-symbol views over the bulk maps.
|
|
94
|
-
*
|
|
95
|
-
* File-dependency graph:
|
|
96
|
-
* - `buildFileDepGraph(db, scope?)` — file → set of files it
|
|
97
|
-
* imports/references.
|
|
98
|
-
*
|
|
99
|
-
* Layer position: top of the layering — uses path-resolver,
|
|
100
|
-
* symbol-lookup, and definition-catalog. Identifier-attribution sits
|
|
101
|
-
* alongside (re-exported here as `getSourceReferenceSites` /
|
|
102
|
-
* `buildSourceFallbackCallerFiles` so callers don't have to learn a
|
|
103
|
-
* second module name).
|
|
104
|
-
*/
|
|
105
|
-
|
|
92
|
+
type CalleeEvidenceSource = 'ast-callsite' | 'semantic-callee' | 'scip-chunk';
|
|
106
93
|
interface CalleeRow {
|
|
107
94
|
symbol: string;
|
|
108
95
|
file: string;
|
|
109
96
|
chunkId: number;
|
|
97
|
+
source: CalleeEvidenceSource;
|
|
110
98
|
}
|
|
111
|
-
declare function buildFileDepGraph(db: ScipDatabase, scope?: string): Map<string, Set<string>>;
|
|
112
99
|
/**
|
|
113
100
|
* Bulk callee map: for each definition in the list, find every symbol it
|
|
114
101
|
* actually calls.
|
|
@@ -133,28 +120,21 @@ declare function buildFileDepGraph(db: ScipDatabase, scope?: string): Map<string
|
|
|
133
120
|
*/
|
|
134
121
|
declare function buildCalleeMap(db: ScipDatabase, definitions: ReadonlyArray<SymbolMatch>, opts?: {
|
|
135
122
|
additive?: boolean;
|
|
123
|
+
semantic?: boolean;
|
|
136
124
|
}): Map<number, CalleeRow[]>;
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
* with same-file preference. For non-AST files, callers come from SCIP's
|
|
144
|
-
* mentions table (chunk-level) with self-reference filtering.
|
|
145
|
-
*
|
|
146
|
-
* If `definitions` is supplied, references that fall inside the symbol's own
|
|
147
|
-
* defining file are treated as potential self-references and only counted
|
|
148
|
-
* when they originate from a different document.
|
|
149
|
-
*/
|
|
150
|
-
declare function buildCrossFileCallerMap(db: ScipDatabase, definitions?: ReadonlyArray<SymbolLocation>): Map<number, Set<string>>;
|
|
125
|
+
|
|
126
|
+
declare function buildFileDepGraph(db: ScipDatabase, scope?: string): Map<string, Set<string>>;
|
|
127
|
+
|
|
128
|
+
declare function buildCrossFileCallerMap(db: ScipDatabase, definitions?: ReadonlyArray<SymbolLocation>, opts?: {
|
|
129
|
+
semantic?: boolean;
|
|
130
|
+
}): Map<number, Set<string>>;
|
|
151
131
|
|
|
152
132
|
/**
|
|
153
133
|
* Identifier-attribution module — one owner of "given a textual identifier
|
|
154
134
|
* hit in file F, which SCIP symbol(s) does it refer to?"
|
|
155
135
|
*
|
|
156
136
|
* Pre-this-module the same logic lived in four places (sourceCandidateLines,
|
|
157
|
-
* importAttributedCandidateLines,
|
|
137
|
+
* importAttributedCandidateLines, findCallerFiles inner loop,
|
|
158
138
|
* dead.ts:resolveLeaf) with subtle drift. Bug fixes in one site silently
|
|
159
139
|
* coexisted with the bug in the others. The Vue support and interface-
|
|
160
140
|
* dispatch fixes from earlier had to touch all four sites separately.
|
|
@@ -203,11 +183,18 @@ interface CallableSignature {
|
|
|
203
183
|
* On first call per file, walks the entire AST once and indexes every
|
|
204
184
|
* callable's signature by (startLine, endLine). Subsequent calls are O(1)
|
|
205
185
|
* Map lookups — critical when called for thousands of candidates.
|
|
186
|
+
*
|
|
187
|
+
* scip-query: ignore-wrapper — public AST-signature primitive used through
|
|
188
|
+
* ProjectIndex; callers should not know the per-tree signature cache shape.
|
|
206
189
|
*/
|
|
207
190
|
declare function getCallableSignature(db: ScipDatabase, relativePath: string, startLine: number, endLine: number): CallableSignature | null;
|
|
208
191
|
|
|
209
192
|
type SourceReferenceKind = 'identifier' | 'cross-language-dispatch' | 'rust-attribute';
|
|
210
|
-
type
|
|
193
|
+
type DefaultSourceReferenceTarget = ReturnType<typeof attributeIdentifier>[number];
|
|
194
|
+
interface SourceReferenceTarget {
|
|
195
|
+
symbolId: number;
|
|
196
|
+
relativePath: string;
|
|
197
|
+
}
|
|
211
198
|
interface SourceReferenceHit {
|
|
212
199
|
sourceFile: string;
|
|
213
200
|
name: string;
|
|
@@ -221,7 +208,16 @@ interface ScanSourceReferencesOptions {
|
|
|
221
208
|
includeCrossLanguageDispatchNames?: boolean;
|
|
222
209
|
includeRustAttributeNames?: boolean;
|
|
223
210
|
identifierResolution?: 'strict' | 'permissive';
|
|
211
|
+
candidateNames?: ReadonlySet<string>;
|
|
224
212
|
skipPath?: (relativePath: string) => boolean;
|
|
213
|
+
resolveTargets?: (ctx: SourceReferenceResolveContext) => Iterable<SourceReferenceTarget>;
|
|
214
|
+
afterPath?: (relativePath: string) => void;
|
|
215
|
+
}
|
|
216
|
+
interface SourceReferenceResolveContext {
|
|
217
|
+
sourceFile: string;
|
|
218
|
+
name: string;
|
|
219
|
+
kind: SourceReferenceKind;
|
|
220
|
+
defaultTargets: () => readonly DefaultSourceReferenceTarget[];
|
|
225
221
|
}
|
|
226
222
|
declare function scanSourceReferences(db: ScipDatabase, opts: ScanSourceReferencesOptions, visit: (hit: SourceReferenceHit) => void): void;
|
|
227
223
|
|
|
@@ -246,9 +242,21 @@ declare class ProjectIndex {
|
|
|
246
242
|
productionCallableDefinitions(opts?: ProductionCallableDefinitionsOptions): IndexedDefinition[];
|
|
247
243
|
calleeMap(definitions: ReadonlyArray<SymbolMatch>, opts?: {
|
|
248
244
|
additive?: boolean;
|
|
245
|
+
semantic?: boolean;
|
|
249
246
|
}): ReturnType<typeof buildCalleeMap>;
|
|
250
|
-
crossFileCallerMap(definitions?: ReadonlyArray<SymbolMatch
|
|
247
|
+
crossFileCallerMap(definitions?: ReadonlyArray<SymbolMatch>, opts?: {
|
|
248
|
+
semantic?: boolean;
|
|
249
|
+
}): ReturnType<typeof buildCrossFileCallerMap>;
|
|
251
250
|
sourceFallbackCallerFiles(definitions: ReadonlyArray<IndexedDefinition>): ReturnType<typeof findCallerFiles>;
|
|
251
|
+
callerFileMap(definitions: ReadonlyArray<IndexedDefinition>, opts?: {
|
|
252
|
+
semantic?: boolean;
|
|
253
|
+
sourceFallback?: boolean;
|
|
254
|
+
}): Map<number, Set<string>>;
|
|
255
|
+
frameworkReferencedSymbolIds(definitions: ReadonlyArray<IndexedDefinition>): Set<number>;
|
|
256
|
+
symbolsWithNonSelfCallees(definitions: ReadonlyArray<IndexedDefinition>, opts?: {
|
|
257
|
+
additive?: boolean;
|
|
258
|
+
semantic?: boolean;
|
|
259
|
+
}): Set<number>;
|
|
252
260
|
fileDependencyGraph(scope?: string): ReturnType<typeof buildFileDepGraph>;
|
|
253
261
|
fileKind(relativePath: string): ReturnType<typeof classifyFile>;
|
|
254
262
|
hasSuppressionComment(definition: Pick<IndexedDefinition, 'relativePath' | 'startLine'>): boolean;
|
|
@@ -283,239 +291,4 @@ declare function shortenSymbol(raw: string): string;
|
|
|
283
291
|
*/
|
|
284
292
|
declare function leafName(raw: string): string;
|
|
285
293
|
|
|
286
|
-
|
|
287
|
-
* Detect which languages are present in a project directory by checking for
|
|
288
|
-
* marker files, root-level project files, and source-file extensions.
|
|
289
|
-
*/
|
|
290
|
-
declare function detectLanguages(projectRoot: string): SupportedLanguage[];
|
|
291
|
-
|
|
292
|
-
interface AugmentAuxiliaryDocumentsOptions {
|
|
293
|
-
projectRoot: string;
|
|
294
|
-
dbPath: string;
|
|
295
|
-
extensions?: readonly string[];
|
|
296
|
-
onStatus?: (message: string) => void;
|
|
297
|
-
}
|
|
298
|
-
interface AugmentAuxiliaryDocumentsResult {
|
|
299
|
-
scanned: number;
|
|
300
|
-
inserted: number;
|
|
301
|
-
existing: number;
|
|
302
|
-
}
|
|
303
|
-
/**
|
|
304
|
-
* Add source files that upstream SCIP indexers skipped to the SQLite
|
|
305
|
-
* documents table. Vue SFCs are the motivating case: scip-typescript can
|
|
306
|
-
* resolve imports to generated TS, but it does not emit `.vue` documents.
|
|
307
|
-
*/
|
|
308
|
-
declare function augmentAuxiliaryDocuments(opts: AugmentAuxiliaryDocumentsOptions): AugmentAuxiliaryDocumentsResult;
|
|
309
|
-
|
|
310
|
-
interface AugmentVueResolvedOptions {
|
|
311
|
-
projectRoot: string;
|
|
312
|
-
dbPath: string;
|
|
313
|
-
tsconfig: string;
|
|
314
|
-
onStatus?: (message: string) => void;
|
|
315
|
-
}
|
|
316
|
-
interface AugmentVueResolvedResult {
|
|
317
|
-
vueFiles: number;
|
|
318
|
-
resolvedReferences: number;
|
|
319
|
-
insertedMentions: number;
|
|
320
|
-
skippedReferences: number;
|
|
321
|
-
syntheticSymbols: number;
|
|
322
|
-
}
|
|
323
|
-
declare function augmentVueResolvedReferences(opts: AugmentVueResolvedOptions): AugmentVueResolvedResult;
|
|
324
|
-
|
|
325
|
-
/**
|
|
326
|
-
* Indexer configurations for each supported language.
|
|
327
|
-
* Each entry describes how to produce a SCIP index for that language.
|
|
328
|
-
*
|
|
329
|
-
* The `scip` CLI binary is required for all languages (to convert protobuf -> SQLite).
|
|
330
|
-
* Each language also needs its own SCIP indexer installed.
|
|
331
|
-
*/
|
|
332
|
-
declare const INDEXER_CONFIGS: Record<SupportedLanguage, IndexerConfig>;
|
|
333
|
-
/** Get the indexer config for a language */
|
|
334
|
-
declare function getIndexerConfig(language: SupportedLanguage): IndexerConfig;
|
|
335
|
-
|
|
336
|
-
interface MergeScipResult {
|
|
337
|
-
documentCount: number;
|
|
338
|
-
externalSymbolCount: number;
|
|
339
|
-
inputCount: number;
|
|
340
|
-
}
|
|
341
|
-
/**
|
|
342
|
-
* Merge multiple SCIP indices into a single index message.
|
|
343
|
-
*
|
|
344
|
-
* A SCIP index is a code graph snapshot: metadata about one indexed project plus
|
|
345
|
-
* the documents and external symbols discovered by one or more indexers. Merging
|
|
346
|
-
* means producing one unified snapshot so later conversion to SQLite sees the
|
|
347
|
-
* whole repo instead of whichever language indexed last.
|
|
348
|
-
*/
|
|
349
|
-
declare function mergeScipIndexes(indexes: readonly Index[]): Index;
|
|
350
|
-
declare function mergeScipFiles(inputPaths: readonly string[], outputPath: string): MergeScipResult;
|
|
351
|
-
|
|
352
|
-
/**
|
|
353
|
-
* Check if a binary is available on PATH.
|
|
354
|
-
*/
|
|
355
|
-
declare function isBinaryAvailable(name: string): boolean;
|
|
356
|
-
/**
|
|
357
|
-
* Check if an indexer's binary is available on PATH.
|
|
358
|
-
*/
|
|
359
|
-
declare function isIndexerInstalled(config: IndexerConfig): boolean;
|
|
360
|
-
/**
|
|
361
|
-
* Attempt to auto-install an indexer using its configured install methods.
|
|
362
|
-
* Tries each method in order, checking prerequisites first.
|
|
363
|
-
* Returns true if installation succeeded.
|
|
364
|
-
*/
|
|
365
|
-
declare function tryInstallIndexer(config: IndexerConfig, onStatus: (msg: string) => void): boolean;
|
|
366
|
-
|
|
367
|
-
/**
|
|
368
|
-
* Check if the `scip` CLI binary is available on PATH.
|
|
369
|
-
*/
|
|
370
|
-
declare function isScipInstalled(): boolean;
|
|
371
|
-
/**
|
|
372
|
-
* Get the scip CLI version if installed.
|
|
373
|
-
*/
|
|
374
|
-
declare function getScipVersion(): string | null;
|
|
375
|
-
/**
|
|
376
|
-
* Print instructions for installing the scip CLI binary.
|
|
377
|
-
*/
|
|
378
|
-
declare function printScipInstallInstructions(): void;
|
|
379
|
-
/**
|
|
380
|
-
* Attempt to auto-install the `scip` CLI binary.
|
|
381
|
-
* Tries brew (macOS), then go install, then prints manual instructions.
|
|
382
|
-
* Returns true if installation succeeded.
|
|
383
|
-
*/
|
|
384
|
-
declare function tryInstallScipCli(onStatus: (msg: string) => void): boolean;
|
|
385
|
-
|
|
386
|
-
interface ReindexOptions {
|
|
387
|
-
projectRoot: string;
|
|
388
|
-
/** Override language detection — index only these languages */
|
|
389
|
-
languages?: SupportedLanguage[];
|
|
390
|
-
/** Path for the SCIP protobuf output (default: <projectRoot>/index.scip) */
|
|
391
|
-
outputScip?: string;
|
|
392
|
-
/** Path for the SQLite output (default: <projectRoot>/index.db) */
|
|
393
|
-
outputDb?: string;
|
|
394
|
-
/** Max Node.js heap size in MB (default: 8192) */
|
|
395
|
-
maxHeapMb?: number;
|
|
396
|
-
/** Callback for status updates */
|
|
397
|
-
onStatus?: (message: string) => void;
|
|
398
|
-
/** Extra flags for pnpm-workspace-aware TS indexing */
|
|
399
|
-
pnpmWorkspaces?: boolean;
|
|
400
|
-
/** Skip auto-install prompts */
|
|
401
|
-
skipAutoInstall?: boolean;
|
|
402
|
-
/** Reuse an existing index when tracked source inputs are unchanged (default true). */
|
|
403
|
-
skipIfUnchanged?: boolean;
|
|
404
|
-
/** Permit a partial index when some detected/requested languages fail (default false). */
|
|
405
|
-
allowPartial?: boolean;
|
|
406
|
-
/** Number of language indexers to run at once (default: conservative auto). */
|
|
407
|
-
indexerConcurrency?: number;
|
|
408
|
-
}
|
|
409
|
-
interface ReindexResult {
|
|
410
|
-
/** Languages that were successfully indexed. */
|
|
411
|
-
languages: SupportedLanguage[];
|
|
412
|
-
indexPath: string;
|
|
413
|
-
dbPath: string;
|
|
414
|
-
durationMs: number;
|
|
415
|
-
/** True when existing SCIP/SQLite outputs were reused because inputs were unchanged. */
|
|
416
|
-
reused: boolean;
|
|
417
|
-
/**
|
|
418
|
-
* Languages detected in the project but skipped because their indexer
|
|
419
|
-
* could not be located, installed, or run. Each entry includes the reason.
|
|
420
|
-
*/
|
|
421
|
-
skipped: {
|
|
422
|
-
language: SupportedLanguage;
|
|
423
|
-
reason: string;
|
|
424
|
-
}[];
|
|
425
|
-
}
|
|
426
|
-
/**
|
|
427
|
-
* Reindex a project: detect languages, run the appropriate SCIP indexer(s),
|
|
428
|
-
* and convert the output to SQLite.
|
|
429
|
-
*/
|
|
430
|
-
declare function reindex(opts: ReindexOptions): Promise<ReindexResult>;
|
|
431
|
-
|
|
432
|
-
/**
|
|
433
|
-
* Load project config from .scipquery.json in the project root.
|
|
434
|
-
* Returns defaults for anything not specified.
|
|
435
|
-
*/
|
|
436
|
-
declare function loadProjectConfig(projectRoot: string): ProjectConfig;
|
|
437
|
-
/**
|
|
438
|
-
* Resolve all paths for a project's index files.
|
|
439
|
-
*/
|
|
440
|
-
declare function resolveIndexPaths(projectRoot: string, config?: ProjectConfig): {
|
|
441
|
-
cacheDir: string;
|
|
442
|
-
dbPath: string;
|
|
443
|
-
indexPath: string;
|
|
444
|
-
metaPath: string;
|
|
445
|
-
};
|
|
446
|
-
/**
|
|
447
|
-
* Scaffold a default .scipquery.json in the project root.
|
|
448
|
-
* Does not overwrite an existing config.
|
|
449
|
-
*/
|
|
450
|
-
declare function initProjectConfig(projectRoot: string, languages: string[]): string;
|
|
451
|
-
|
|
452
|
-
interface WatcherOptions {
|
|
453
|
-
projectRoot: string;
|
|
454
|
-
config: ProjectConfig;
|
|
455
|
-
languages?: SupportedLanguage[];
|
|
456
|
-
onStatus?: (status: WatcherStatus) => void;
|
|
457
|
-
onReindexComplete?: (durationMs: number) => void;
|
|
458
|
-
onError?: (error: Error) => void;
|
|
459
|
-
}
|
|
460
|
-
/**
|
|
461
|
-
* File watcher that triggers single-flight background reindexing.
|
|
462
|
-
*
|
|
463
|
-
* Design:
|
|
464
|
-
* - Debounce: waits 30s (configurable) after the last file change
|
|
465
|
-
* - Single-flight: only one reindex runs at a time, never queued
|
|
466
|
-
* - Dirty flag: changes during reindex schedule ONE follow-up
|
|
467
|
-
* - Cooldown: minimum interval between reindex completions
|
|
468
|
-
* - Atomic swap: writes to index.db.tmp, renames on success
|
|
469
|
-
*/
|
|
470
|
-
declare class Watcher {
|
|
471
|
-
private projectRoot;
|
|
472
|
-
private watchConfig;
|
|
473
|
-
private indexPaths;
|
|
474
|
-
private languages?;
|
|
475
|
-
private pnpmWorkspaces;
|
|
476
|
-
private onStatus;
|
|
477
|
-
private onReindexComplete;
|
|
478
|
-
private onError;
|
|
479
|
-
private status;
|
|
480
|
-
private debounceTimer;
|
|
481
|
-
private cooldownTimer;
|
|
482
|
-
private dirty;
|
|
483
|
-
private changedFiles;
|
|
484
|
-
private reindexInFlight;
|
|
485
|
-
private lastReindexEnd;
|
|
486
|
-
private fsWatchers;
|
|
487
|
-
private gitignoreFilter;
|
|
488
|
-
private extraIgnore;
|
|
489
|
-
private stopped;
|
|
490
|
-
constructor(opts: WatcherOptions);
|
|
491
|
-
/** Start watching for file changes */
|
|
492
|
-
start(): void;
|
|
493
|
-
/** Stop watching and clean up */
|
|
494
|
-
stop(): void;
|
|
495
|
-
private handleFileChange;
|
|
496
|
-
private triggerReindex;
|
|
497
|
-
/**
|
|
498
|
-
* Run the reindex in a forked child process.
|
|
499
|
-
* Writes to index.db.tmp, then atomically renames to index.db.
|
|
500
|
-
*/
|
|
501
|
-
private runReindex;
|
|
502
|
-
private setStatus;
|
|
503
|
-
private clearDebounceTimer;
|
|
504
|
-
private clearCooldownTimer;
|
|
505
|
-
}
|
|
506
|
-
|
|
507
|
-
interface InstallSkillsResult {
|
|
508
|
-
installed: string[];
|
|
509
|
-
skipped: string[];
|
|
510
|
-
alreadyLinked: string[];
|
|
511
|
-
}
|
|
512
|
-
/**
|
|
513
|
-
* Install scip-query skills into both Claude Code (~/.claude/skills/)
|
|
514
|
-
* and Codex (~/.codex/skills/). Uses symlinks (junctions on Windows)
|
|
515
|
-
* so skills auto-update when the package updates.
|
|
516
|
-
*/
|
|
517
|
-
declare function installSkills(opts?: {
|
|
518
|
-
quiet?: boolean;
|
|
519
|
-
}): InstallSkillsResult;
|
|
520
|
-
|
|
521
|
-
export { INDEXER_CONFIGS, IndexedDefinition, IndexerConfig, ProjectConfig, ProjectIndex, ScipDatabase, ScipLocalSymbol, ScipSymbol, SupportedLanguage, SymbolLocation, SymbolMatch, Watcher, WatcherStatus, augmentAuxiliaryDocuments, augmentVueResolvedReferences, detectLanguages, getIndexerConfig, getScipVersion, initProjectConfig, installSkills, isBinaryAvailable, isIndexerInstalled, isScipInstalled, leafName, loadProjectConfig, mergeScipFiles, mergeScipIndexes, parseSymbol, printScipInstallInstructions, reindex, resolveIndexPaths, shortenSymbol, tryInstallIndexer, tryInstallScipCli };
|
|
294
|
+
export { ProjectIndex, ScipDatabase, leafName, parseSymbol, shortenSymbol };
|