feat(parsers): add Kotlin language support#18
Merged
tob-scott-a merged 1 commit intomainfrom Apr 23, 2026
Merged
Conversation
Handles .kt and .kts files using tree-sitter-language-pack's kotlin grammar (transitive dep, no new installs). Extracts: - Top-level functions (fun main, suspend fun fetch, ...) - Classes, interfaces, data classes, objects, enum classes - Methods inside class_body and enum_class_body - Parameters from function_value_parameters and their user_type / type_identifier / nullable_type annotations - Return types from the type node following `:` on the signature - Imports — captured as graph.dependencies Entrypoint detectors for Kotlin: - Spring MVC / WebFlux annotations (@GetMapping, @PostMapping, etc.) reusing the existing Java detector since the annotations are identical across the two languages. - Android component lifecycle methods: onCreate, onStart, onResume, onNewIntent, onActivityResult, onReceive, onBind, onHandleIntent. These are attacker-reachable when the component is exported — we over-detect on purpose and rely on the override file to tighten. Known gap (parallel to Swift, documented in parser docstring): `throw` statements share their AST node type with `return`/`break`/`continue` via `jump_expression`, so exception-type capture needs a Kotlin-specific walk filtered by the leading `throw` token. Deferred. 14 new tests: Kotlin parser, Kotlin entrypoint detection. README supported-languages and framework-coverage tables updated. Roadmap left before v0.2.0: Dart/Flutter parser, Go/Ruby/C++ entrypoint detectors (Option A), branches + docstring in JSON export (Option B). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
Handles .kt and .kts files using tree-sitter-language-pack's kotlin grammar (transitive dep, no new installs). Extracts:
:on the signatureEntrypoint detectors for Kotlin:
Known gap (parallel to Swift, documented in parser docstring):
throwstatements share their AST node type withreturn/break/continueviajump_expression, so exception-type capture needs a Kotlin-specific walk filtered by the leadingthrowtoken. Deferred.14 new tests: Kotlin parser, Kotlin entrypoint detection. README supported-languages and framework-coverage tables updated.
Roadmap left before v0.2.0: Dart/Flutter parser, Go/Ruby/C++ entrypoint detectors (Option A), branches + docstring in JSON export (Option B).