Improve Kotlin comment filtering#79
Open
Vladyslav-Kuksiuk wants to merge 7 commits into
Open
Conversation
…e-kotlin-comment-filtering
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses Issue #64 by introducing a Kotlin-specific comment filter so Kotlin sources no longer rely on the Java-style marker scanner, improving handling for nested block comments and Kotlin raw (""") strings with interpolation.
Changes:
- Added
KotlinCommentFilterwith Kotlin-aware scanning for nested block comments, raw strings, and${...}interpolation filtering. - Registered the Kotlin filter for
.ktand.ktsextensions. - Added Kotlin-focused golden tests for multiple comment-retention modes and Kotlin-specific constructs.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| embedding/commentfilter/kotlin.go | New Kotlin-aware comment filter implementation (nested block comments, raw strings, interpolation). |
| embedding/commentfilter/filter_test.go | Adds Kotlin golden tests for comment modes and raw string/interpolation behavior. |
| embedding/commentfilter/config.go | Switches .kt/.kts to use KotlinCommentFilter instead of Java-style marker filtering. |
Oleg-Melnik
approved these changes
Jul 3, 2026
Oleg-Melnik
left a comment
Collaborator
There was a problem hiding this comment.
@Vladyslav-Kuksiuk LGTM with minor comment to address.
| @@ -0,0 +1,361 @@ | |||
| // Copyright 2026, TeamDev. All rights reserved. | |||
Collaborator
There was a problem hiding this comment.
The kotlin.go file name looks too general. Consider using a more specific name, such as kotlin_filter.go, etc.
MykytaPimonovTD
approved these changes
Jul 5, 2026
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.
This PR improve Kotlin comment filtering.
Resolves this issue.