diff --git a/gitnexus/src/core/ingestion/languages/typescript/captures.ts b/gitnexus/src/core/ingestion/languages/typescript/captures.ts index 93eb4f599..22f48e80d 100644 --- a/gitnexus/src/core/ingestion/languages/typescript/captures.ts +++ b/gitnexus/src/core/ingestion/languages/typescript/captures.ts @@ -124,6 +124,9 @@ function shouldEmitReadMember(memberNode: SyntaxNode): boolean { } } +/** Walks the parent chain from `node` (inclusive), returning the first node + * whose type matches, or null. Faster than `findNodeAtRange` when the caller + * already holds the anchor node — avoids re-scanning the tree from the root. */ function findSelfOrAncestorOfType(node: SyntaxNode | undefined, type: string): SyntaxNode | null { if (node === undefined) return null; let current: SyntaxNode | null = node; @@ -134,6 +137,8 @@ function findSelfOrAncestorOfType(node: SyntaxNode | undefined, type: string): S return null; } +/** Walks the parent chain from `node` (inclusive), returning the first node + * whose type is in the set, or null. Plural form of {@link findSelfOrAncestorOfType}. */ function findSelfOrAncestorOfTypes( node: SyntaxNode | undefined, types: readonly string[], diff --git a/gitnexus/src/core/ingestion/parsing-processor.ts b/gitnexus/src/core/ingestion/parsing-processor.ts index 7a669504e..73a72aa22 100644 --- a/gitnexus/src/core/ingestion/parsing-processor.ts +++ b/gitnexus/src/core/ingestion/parsing-processor.ts @@ -894,12 +894,12 @@ export const processParsing = async ( { skippedPaths: err.fallbackExcludePaths, }, - 'Skipping worker-timeout files in sequential fallback:', + 'Skipping worker-excluded files in sequential fallback:', ); reportProgress?.( lastProgress, files.length, - `Skipping ${files.length - fallbackFiles.length} worker-timeout file(s) in sequential fallback`, + `Skipping ${files.length - fallbackFiles.length} worker-excluded file(s) in sequential fallback`, ); } logger.warn({ message }, 'Worker pool parsing stopped; continuing with sequential parser:'); diff --git a/gitnexus/test/unit/parsing-worker-fallback.test.ts b/gitnexus/test/unit/parsing-worker-fallback.test.ts index 8525e263b..3308cf03f 100644 --- a/gitnexus/test/unit/parsing-worker-fallback.test.ts +++ b/gitnexus/test/unit/parsing-worker-fallback.test.ts @@ -70,7 +70,7 @@ describe('processParsing worker fallback', () => { ); expect(result).toBeNull(); - expect(progressDetails).toContain('Skipping 1 worker-timeout file(s) in sequential fallback'); + expect(progressDetails).toContain('Skipping 1 worker-excluded file(s) in sequential fallback'); expect( graph.nodes.some((node) => node.label === 'Function' && node.properties.name === 'a'), ).toBe(true); @@ -106,7 +106,7 @@ describe('processParsing worker fallback', () => { ); expect(result).toBeNull(); - expect(progressDetails).toContain('Skipping 1 worker-timeout file(s) in sequential fallback'); + expect(progressDetails).toContain('Skipping 1 worker-excluded file(s) in sequential fallback'); expect( graph.nodes.some((node) => node.label === 'Function' && node.properties.name === 'a'), ).toBe(true); @@ -145,7 +145,7 @@ describe('processParsing worker fallback', () => { ); expect(result).toBeNull(); - expect(progressDetails).toContain('Skipping 1 worker-timeout file(s) in sequential fallback'); + expect(progressDetails).toContain('Skipping 1 worker-excluded file(s) in sequential fallback'); expect( graph.nodes.some((node) => node.label === 'Function' && node.properties.name === 'a'), ).toBe(true); @@ -185,7 +185,7 @@ describe('processParsing worker fallback', () => { 'Sequential fallback after worker issue: replacement worker failed', ); expect( - progressDetails.some((d) => d.startsWith('Skipping ') && d.includes('worker-timeout file')), + progressDetails.some((d) => d.startsWith('Skipping ') && d.includes('worker-excluded file')), ).toBe(false); expect( graph.nodes.some((node) => node.label === 'Function' && node.properties.name === 'a'),