feat(lang_parser): add Kotlin language support - #97
Open
Corentic AI (tobiasendres-dev) wants to merge 1 commit into
Open
feat(lang_parser): add Kotlin language support#97Corentic AI (tobiasendres-dev) wants to merge 1 commit into
Corentic AI (tobiasendres-dev) wants to merge 1 commit into
Conversation
|
Corentic AI (@tobiasendres-dev) please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.
Contributor License AgreementContribution License AgreementThis Contribution License Agreement (“Agreement”) is agreed to by the party signing below (“You”),
|
Query-based adapter per the 'no self-maintained lists' architecture: - queries/kotlin/tags.scm: vendored verbatim from fwcd/tree-sitter-kotlin @ 1852ea17 (community-maintained definitions and call references) - queries/kotlin/imports.scm: closes the one known upstream gap (import captures + unnamed companion objects); candidate for upstreaming into fwcd - kotlin_parser.py: pure query adapter — no declaration regexes, no hand-maintained node-type lists. Declares a capture CONTRACT that is verified at load time; missing captures fail loudly instead of silently producing an empty graph. - registry.py, tree_sitter_backend.py: wiring + grammar candidate - pyproject.toml: fwcd grammar pinned by commit until wheels are published Signed-off-by: Tobias J. Endres <tobias.endres@corentic.eu>
Corentic AI (tobiasendres-dev)
force-pushed
the
feat/kotlin-lang-parser
branch
from
August 24, 2026 23:37
5a907f2 to
198f34f
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.
What
Adds Kotlin (
.kt/.kts) support tolang_parser, following the pattern established by PR #67.Why
Kotlin repos currently encode to an empty RPG.
lang_parser/registry.pysupports exactly 7 languages, so every.ktfile failsis_supported_source()and the encoder reportsTotal valid source files to parse: 0, producingnode_count: 1, edge_count: 0. Notably, the AST dep-graph builder does understand Kotlin, which masks the problem: encodes "succeed" while the semantic graph is empty.Implementation
config/kotlin.py:KOTLIN_CONFIG—class_declarationcovers class/interface/enum class,object_declarationmaps singletons/companion objects to class unitskotlin_parser.py:KotlinParser, mirroringgo_parser.py's structure (regex + tree-sitter hybrid) for consistency with existing parsersregistry.py/tree_sitter_backend.py: registration +tree-sitter-kotlingrammar candidatepyproject.toml: addstree-sitter-kotlin>=1.1.0alongside the other grammarsDetails worth reviewing:
import(tree-sitter-grammars fork, used by the PyPI package) andimport_header(fwcd grammar) node names — known fork divergencenavigation_expression(Kotlin-specific node type)data/sealed/enum/value/fun interface), companion objects, inner classes, typealiases, suspend and context-receiver functionsTesting
.kt/.ktsfiles from a real-world Spring Boot multi-module project parse without crashes or syntax errors