Add Kotlin language support to code graph analyzer#626
Closed
Copilot wants to merge 5 commits intobackend/add-kotlin-supportfrom
Closed
Add Kotlin language support to code graph analyzer#626Copilot wants to merge 5 commits intobackend/add-kotlin-supportfrom
Copilot wants to merge 5 commits intobackend/add-kotlin-supportfrom
Conversation
Migrated from FalkorDB/code-graph-backend PR #95. Original issue: FalkorDB/code-graph-backend#93 Resolves #531 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Replace wildcard import with explicit Entity and File imports - Fix tree-sitter queries: Kotlin grammar uses 'identifier' not 'type_identifier' - Fix get_entity_name: use 'identifier' for all entity types - Separate superclass/interface in add_symbols: first delegation specifier is base_class, rest are implement_interface - Use self._captures() instead of direct query.captures() calls - Handle constructor_invocation in delegation specifiers (e.g. Shape(...)) - Fix source_analyzer second_pass: use entity.resolved_symbols instead of iterating raw symbol nodes, so graph edges use resolved entity IDs - Fix resolve_method: use 'identifier' instead of 'simple_identifier' - Add unit tests and Kotlin fixture (11 tests, all passing) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Fix resolve_symbol return type annotation: Entity -> list[Entity] in abstract and Kotlin implementations to match actual behavior - Fix pyproject.toml indentation for tree-sitter-kotlin dependency - Add path.resolve() in analyze_sources for LSP compatibility - Remove unused exception variable Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ion heuristic - Restore C# analyzer registration in SourceAnalyzer (removed unintentionally) - Fix resolve_symbol return type annotation in Java/Python analyzers (-> list[Entity]) - Improve Kotlin delegation specifier handling: use constructor_invocation as class signal instead of blindly treating first specifier as base_class Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add Kotlin language support
Add Kotlin language support to code graph analyzer
Mar 22, 2026
57ed7da to
e5eda92
Compare
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.
Adds Kotlin (
.kt,.kts) analysis to the code graph pipeline alongside existing Python, Java, and C# support.New:
KotlinAnalyzer_get_delegation_types()—constructor_invocationspecifiers →base_class, plainuser_typespecifiers →implement_interfaceNullLanguageServer(AST-based symbol resolution within the analyzed project; full LSP integration deferred)SourceAnalyzerchanges.kt/.ktsextensions andKotlinAnalyzersecond_pass()iteratesentity.resolved_symbols(resolvedEntityobjects with graph IDs) instead of raw tree-sitter node IDsanalyze_sources()callspath.resolve()to normalize paths before populatingself.files, preventing LSP definition location mismatchesOther fixes
AbstractAnalyzer.resolve_symbolabstract method and all implementations (Python, Java, Kotlin) consistently annotated-> list[Entity]pyproject.toml: addedtree-sitter-kotlin>=1.1.0,<2.0.0with consistent indentationTests
tests/test_kotlin_analyzer.pycovering class/interface/object/function extraction, labels, inheritance, and dependency detectiontests/source_files/kotlin/sample.kt📍 Connect Copilot coding agent with Jira, Azure Boards or Linear to delegate work to Copilot in one click without leaving your project management tool.