Skip to content

Commit 7465f9b

Browse files
committed
fix: correct NativeAddon.resolveImports signature and remove unused disposeParsers parameter
- types.ts: fix resolveImport and resolveImports signatures to match actual native call sites in resolve.ts (remove spurious extensions param, add knownFiles param, fix return type) - domain/parser.ts: remove unused _parsers parameter from disposeParsers — no caller ever passes it, and the function always operates on module-level caches - domain/analysis/dependencies.ts: move biome-ignore to correct line (suppression had no effect on wrong line) Impact: 4 functions changed, 9 affected
1 parent 306b833 commit 7465f9b

3 files changed

Lines changed: 5 additions & 11 deletions

File tree

src/domain/analysis/dependencies.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,9 @@ function buildTransitiveCallers(
7474
const visited = new Set([nodeId]);
7575
let frontier = callers
7676
.map((c) => {
77-
// biome-ignore lint/suspicious/noExplicitAny: DB row type
7877
const row = db
7978
.prepare('SELECT id FROM nodes WHERE name = ? AND kind = ? AND file = ? AND line = ?')
79+
// biome-ignore lint/suspicious/noExplicitAny: DB row type
8080
.get(c.name, c.kind, c.file, c.line) as any;
8181
return row ? { ...c, id: row.id } : null;
8282
})

src/domain/parser.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ export async function createParsers(): Promise<Map<string, any>> {
115115
* Call this between repeated builds in the same process (e.g. benchmarks)
116116
* to prevent memory accumulation that can cause segfaults.
117117
*/
118-
export function disposeParsers(_parsers?: Map<string, any>): void {
118+
export function disposeParsers(): void {
119119
if (_cachedParsers) {
120120
for (const [id, parser] of _cachedParsers) {
121121
if (parser && typeof parser.delete === 'function') {

src/types.ts

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1678,19 +1678,13 @@ export interface NativeAddon {
16781678
dataflow: boolean,
16791679
ast: boolean,
16801680
): unknown[];
1681-
resolveImport(
1682-
fromFile: string,
1683-
importSource: string,
1684-
rootDir: string,
1685-
extensions: string[],
1686-
aliases: unknown,
1687-
): string | null;
1681+
resolveImport(fromFile: string, importSource: string, rootDir: string, aliases: unknown): string;
16881682
resolveImports(
16891683
items: Array<{ fromFile: string; importSource: string }>,
16901684
rootDir: string,
1691-
extensions: string[],
16921685
aliases: unknown,
1693-
): Array<{ key: string; resolved: string | null }>;
1686+
knownFiles: string[] | null,
1687+
): Array<{ fromFile: string; importSource: string; resolvedPath: string }>;
16941688
computeConfidence(callerFile: string, targetFile: string, importedFrom: string | null): number;
16951689
detectCycles(edges: Array<{ source: string; target: string }>): string[][];
16961690
buildCallEdges(files: unknown[], nodes: unknown[], builtinReceivers: string[]): unknown[];

0 commit comments

Comments
 (0)