Conversation
Add deep extraction for Android patterns: - Room database: entities, DAOs, foreign keys, queries - Hilt DI: modules, providers, injection tracking - Resource refs: R.string/drawable/layout/etc detection - Enhanced manifest: intent filters, metadata, application class New extractors: - android_room.rs: Room pattern extraction with relationships - android_hilt.rs: Hilt DI graph extraction - android_resource_refs.rs: XML resource reference tracking - xml_generic.rs: Generic XML file handling Test fixtures (34 files): - Kotlin patterns: Room, Hilt, coroutines, generics, extensions - Android XML: manifest, layouts, drawables, resources - TV app scenario: complete project structure Tests (34 comprehensive tests): - kotlin_extraction_tests.rs (8 tests) - xml_extraction_tests.rs (12 tests) - android_integration_tests.rs (8 tests) - android_performance_tests.rs (6 tests) Documentation: - android-support.md: User guide - android-kotlin-xml-improvements.md: Technical summary - android-query-examples.md: Query examples All 34 tests passing. Build time: 0.16s
- Remove duplicate AndroidResourceRefExtractor call per Kotlin file
- Replace +100 magic-offset FK slice with brace-counting class body scan
- Fix Hilt provider-to-module attribution using position-based span lookup
- Hoist param_re compilation out of inject loop
- Replace silent unwrap_or("") with eprintln! warning + early return on non-UTF-8 input
- Narrow glob re-exports for new modules to explicit named exports
- cargo fmt all new Android extractor files - hoist query_re and from_re outside DAO loop (clippy::regex-creation-in-loops) - prefix unused filter_content and entities params with underscore
- Relax android_performance_tests thresholds for debug builds (50ms→200ms, 100ms→500ms) - Fix race condition in batched_insert_tests where insert_elements async invalidation beat the cache assertion; now waits and repopulates before checking - Add 'limit' param to mcp_tests tool param allowlist for get_doc_tree
Store absolute project path during 'leankg init' to enable MCP server to route to correct project database even when started from different directory. Includes warning if project moved and fallback to search. Changes: - config/project.rs: add project_path: Option<PathBuf> to ProjectSettings - main.rs: populate project_path with current_dir() during init - mcp/server.rs: resolve project root using project_path first - mcp/tools.rs: add project param to multiple tools - mcp/server.rs: parse orchestrate intent for file routing Backwards compatible: configs without project_path work as before.
- Untrack .mcp.json (hardcoded local paths) and add to .gitignore - Document find_class_body_end byte-index semantics for UTF-8 correctness - Add confidence rationale and limitation comments for DAO heuristic - Enrich DAO relationship metadata with heuristic name and caveat note
- Add 7 integration tests for GenericXmlExtractor: - Root element extraction - Android file exclusion (manifest, /res/) - XML declaration handling - Self-closing tag support - Empty content handling - Invalid UTF-8 handling - File path preservation - Document XML extraction limitation in: - docs/android-support.md (Limitations section) - src/indexer/xml_generic.rs (rustdoc) - Optimize regex compilation with OnceLock in xml_generic.rs All 19 XML extraction tests passing.
Implements annotation extraction, call graph building, resource linking, and Gradle module extraction capabilities. Fixes include improved annotated expression handling during traversal and accurate extension function detection within the AST.
- Add FragmentNavExtractor for FragmentManager patterns - Add LeanbackNavExtractor for TV navigation - Wire extractors into indexer pipeline - Add MCP tools: get_nav_graph, find_route, get_screen_args, get_nav_callers - Add compress_nav_graph for response compression - Fix test validation for new tool parameters - Fix clippy warnings
- Re-add required params to find_route, get_screen_args, get_nav_callers (handler enforces them, schema must match) - Remove unused _FRAGMENT_ADD_RE static - Remove #![allow(dead_code)] suppression from leanback Clippy clean, fmt clean, 313 tests pass
1. Add 'kt' to mcp_index lang filter example (tools.rs) - Documents that Kotlin is a supported language 2. Wire Android extractors into sync indexer (mod.rs) - index_file_sync now runs Room, Hilt, annotations, nav, resource extractors - Matches feature parity with parallel indexer path 3. Implement extract_kotlin_dsl() in JetpackNavExtractor - Parses Compose Navigation DSL: composable(route=...), navigation(...), argument(...) - Extracts nav_destination, nav_argument, nav_action elements - Uses regex to find route definitions and navigate() calls - Confidence scores: 0.85 for args, 0.75 for inferred actions
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.
Summary
Changes
New extractors:
android_room.rs— Room entities, DAOs, databases, foreign keys, DAO queriesandroid_hilt.rs— Hilt modules, providers (correctly attributed via body spans), injection trackingandroid_resource_refs.rs—R.string/drawable/layout/etcreference trackingxml_generic.rs— Generic XML file handlingEnhanced:
android_manifest.rs— intent filters, metadata, application class extractionmod.rs— Kotlin files now run Room/Hilt/resource-ref extractors; XML added to indexed extensionsTests: 34 tests across unit, integration, and performance suites — all passing