Add Kotlin language support#625
Closed
Copilot wants to merge 5 commits intobackend/add-kotlin-supportfrom
Closed
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
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) to the analyzer pipeline alongside Python, Java, and C#, using tree-sitter-kotlin for AST-based extraction.Analyzer (
api/analyzers/kotlin/analyzer.py)class_declaration,object_declaration, andfunction_declarationnodesClass,Interface(detected viainterfacekeyword child),Object,Method,Function/** ... */) extraction viaprev_siblinginspection_get_delegation_types()walks delegation specifiers in order:constructor_invocation→base_class, plainuser_type→implement_interfaceresolve_symbolreturnslist[Entity]consistent with the abstract base contractPipeline wiring (
api/analyzers/source_analyzer.py).kt/.ktsin theanalyzersdict andanalyze_sourcesglobNullLanguageServerfor Kotlin (kotlin-language-server not yet integrated; AST-based resolution handles same-file symbols)path = path.resolve()added at top ofanalyze_sourcesto ensure LSP definition paths matchself.fileskeysAbstract base (
api/analyzers/analyzer.py)resolve_symbolsignature corrected to-> list[Entity]on the abstract method and all implementations (Python, Java, Kotlin)Tests
tests/test_kotlin_analyzer.py: 11 unit tests covering entity extraction, labels, inheritance symbol separation, and dependency detectiontests/source_files/kotlin/sample.kt: fixture with class/interface/object/function, delegation specifiers, and KDoc comments✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.