From 00c90d476fbb1885e36eef9b8070a8e1e9dcad55 Mon Sep 17 00:00:00 2001 From: Gergo Magyar Date: Mon, 16 Mar 2026 21:00:16 +0000 Subject: [PATCH] reorganise --- gitnexus/src/core/ingestion/type-extractors/jvm.ts | 4 ++-- gitnexus/src/core/ingestion/type-extractors/python.ts | 2 +- gitnexus/src/core/ingestion/type-extractors/rust.ts | 2 +- gitnexus/src/core/ingestion/type-extractors/types.ts | 10 +++++----- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/gitnexus/src/core/ingestion/type-extractors/jvm.ts b/gitnexus/src/core/ingestion/type-extractors/jvm.ts index 95f7ee7ec..d4b7f9a7c 100644 --- a/gitnexus/src/core/ingestion/type-extractors/jvm.ts +++ b/gitnexus/src/core/ingestion/type-extractors/jvm.ts @@ -143,15 +143,15 @@ const extractJavaPatternBinding: PatternBindingExtractor = (node) => { export const javaTypeConfig: LanguageTypeConfig = { declarationNodeTypes: JAVA_DECLARATION_NODE_TYPES, + forLoopNodeTypes: JAVA_FOR_LOOP_NODE_TYPES, + patternBindingNodeTypes: new Set(['instanceof_expression']), extractDeclaration: extractJavaDeclaration, extractParameter: extractJavaParameter, extractInitializer: extractJavaInitializer, scanConstructorBinding: scanJavaConstructorBinding, - forLoopNodeTypes: JAVA_FOR_LOOP_NODE_TYPES, extractForLoopBinding: extractJavaForLoopBinding, extractPendingAssignment: extractJavaPendingAssignment, extractPatternBinding: extractJavaPatternBinding, - patternBindingNodeTypes: new Set(['instanceof_expression']), }; // ── Kotlin ──────────────────────────────────────────────────────────────── diff --git a/gitnexus/src/core/ingestion/type-extractors/python.ts b/gitnexus/src/core/ingestion/type-extractors/python.ts index 83e1453cc..8fbad67ad 100644 --- a/gitnexus/src/core/ingestion/type-extractors/python.ts +++ b/gitnexus/src/core/ingestion/type-extractors/python.ts @@ -344,6 +344,7 @@ const PATTERN_BINDING_NODE_TYPES: ReadonlySet = new Set(['as_pattern']); export const typeConfig: LanguageTypeConfig = { declarationNodeTypes: DECLARATION_NODE_TYPES, forLoopNodeTypes: FOR_LOOP_NODE_TYPES, + patternBindingNodeTypes: PATTERN_BINDING_NODE_TYPES, extractDeclaration, extractParameter, extractInitializer, @@ -351,5 +352,4 @@ export const typeConfig: LanguageTypeConfig = { extractForLoopBinding, extractPendingAssignment, extractPatternBinding, - patternBindingNodeTypes: PATTERN_BINDING_NODE_TYPES, }; diff --git a/gitnexus/src/core/ingestion/type-extractors/rust.ts b/gitnexus/src/core/ingestion/type-extractors/rust.ts index 4ed23b786..4d65e1d3f 100644 --- a/gitnexus/src/core/ingestion/type-extractors/rust.ts +++ b/gitnexus/src/core/ingestion/type-extractors/rust.ts @@ -271,11 +271,11 @@ const extractPatternBinding: PatternBindingExtractor = ( export const typeConfig: LanguageTypeConfig = { declarationNodeTypes: DECLARATION_NODE_TYPES, + patternBindingNodeTypes: new Set(['let_condition']), extractDeclaration, extractInitializer, extractParameter, scanConstructorBinding, extractPendingAssignment, extractPatternBinding, - patternBindingNodeTypes: new Set(['let_condition']), }; diff --git a/gitnexus/src/core/ingestion/type-extractors/types.ts b/gitnexus/src/core/ingestion/type-extractors/types.ts index 95f774161..704e0fb22 100644 --- a/gitnexus/src/core/ingestion/type-extractors/types.ts +++ b/gitnexus/src/core/ingestion/type-extractors/types.ts @@ -63,6 +63,11 @@ export interface LanguageTypeConfig { declarationNodeTypes: ReadonlySet; /** AST node types for for-each/for-in statements with explicit element types. */ forLoopNodeTypes?: ReadonlySet; + /** Optional allowlist of AST node types on which extractPatternBinding should run. + * When present, extractPatternBinding is only invoked for nodes whose type is in this set, + * short-circuiting the call for all other node types. When absent, every node is passed to + * extractPatternBinding (legacy behaviour). */ + patternBindingNodeTypes?: ReadonlySet; /** Extract a (varName → typeName) binding from a declaration node */ extractDeclaration: TypeBindingExtractor; /** Extract a (varName → typeName) binding from a parameter node */ @@ -91,9 +96,4 @@ export interface LanguageTypeConfig { * The extractor receives the current scope's resolved bindings (read-only) to look up the * source variable's type. Returns undefined for non-matching nodes or unknown source types. */ extractPatternBinding?: PatternBindingExtractor; - /** Optional allowlist of AST node types on which extractPatternBinding should run. - * When present, extractPatternBinding is only invoked for nodes whose type is in this set, - * short-circuiting the call for all other node types. When absent, every node is passed to - * extractPatternBinding (legacy behaviour). */ - patternBindingNodeTypes?: ReadonlySet; }