feat(indexing): per-language grammar maps + derived import maps (B3+B4) - #25
Merged
Merged
Conversation
added 2 commits
September 8, 2026 10:12
…, conditions Wire CALL_NODES/IMPORT_NODE_MAP/ASSIGNMENT_NODE_MAP/CONDITIONAL_NODE_MAP from universal-engine study into CodeParser walk, verified against live tree-sitter grammars for 11 languages. - calls: simple_identifier (Swift/Kotlin/Dart), method_invocation name field (Java), PHP *_call_expression last-name rule, Ruby method target - imports: C/C++ preproc_include regex, Kotlin keyword-import filter, Dart dedup, Ruby call require/include filter - assigns: variable_name left (PHP), directly_assignable_expression + simple_identifier (Swift), name-node RHS - conditional: per-language CONDITIONAL_NODE_MAP replaces shared set - live tests: TestMultiLangCalls (7) + TestMultiLangImports (9) + php assign
…nd language pack flag Route import extraction through a single source of truth: LANGUAGE_IMPORT_NODES is now a derived view of CodeParser.IMPORT_NODE_MAP instead of a separate literal that had drifted for kt/dart/php. - parser._walk_file: run fallback (mode 2) only in the else-branch when ext has no map, behind a double gate (else-branch + language_pack.is_enabled inside iter_import_candidate_nodes); main grammar path stays priority - extract_imports_from_file reads the flag via language_pack.is_enabled (removes env re-read) - dedup moved out to a shared path used by both precise and fallback modes - LANGUAGE_IMPORT_NODES: lazy derivation via module __getattr__ (PEP 562) so parser is never imported at module load; static parser<->language_imports cycle registered as deliberate tech debt in _ALLOWED_CORE_CYCLES (KNOWN_ISSUES 2026-09-08) - tests: TestMapConsistency (card drift), TestFallbackImports (4 integration), fallback-gate negative controls; full suite green
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Fix broken '? Fixed' status marker in the B3 diary entry (cp1251 roundtrip dropped the checkmark) and add B3/B4 entries to the current CHANGELOG section across ru/en/zh.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes: import-map drift (kt/dart/php) + ungated fallback.
B3 — grammar maps wired from universal-engine study
Parser.\CALL_NODES/\IMPORT_NODE_MAP/\ASSIGNMENT_NODE_MAP/\CONDITIONAL_NODE_MAP\ now reflect live tree-sitter grammars verified for 11 languages:
equire/include\
B4 — single source of truth for import node types
\LANGUAGE_IMPORT_NODES\ is now a derived view of \CodeParser.IMPORT_NODE_MAP\ (was a separate literal). Fallback (mode 2) runs only in the else-branch of _walk_file\ for unmapped ext, double-gated by \MSCODEBASE_LANGUAGE_PACK.
Verification