Skip to content

Improve Java comment filtering#80

Open
Vladyslav-Kuksiuk wants to merge 6 commits into
improve-kotlin-comment-filteringfrom
improve-java-comment-filtering
Open

Improve Java comment filtering#80
Vladyslav-Kuksiuk wants to merge 6 commits into
improve-kotlin-comment-filteringfrom
improve-java-comment-filtering

Conversation

@Vladyslav-Kuksiuk

Copy link
Copy Markdown
Collaborator

This PR improves Java comment filtering.

Resolves this issue

@Vladyslav-Kuksiuk Vladyslav-Kuksiuk self-assigned this Jul 3, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves embedding/commentfilter so comment stripping is more language-accurate, notably by teaching the marker-based filter to treat Java """ text blocks as multi-line literals (so // and /* ... */ inside the text block are preserved when comments="none").

Changes:

  • Extend MarkerCommentFilter to track multi-line “text block” literals (e.g., Java """) and skip comment scanning while inside them.
  • Add dedicated comment filters for Kotlin (nested block comments + raw """ strings with ${...} interpolation) and Visual Basic (apostrophe / doc / REM comments).
  • Add regression tests covering Java text blocks, Kotlin raw strings/interpolation, and Visual Basic comment forms.

Reviewed changes

Copilot reviewed 3 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
embedding/commentfilter/marker_comment_filter.go Adds text-block state tracking and scanning helpers to avoid stripping comment markers inside configured multi-line literals.
embedding/commentfilter/config.go Registers Java """ as a text-block delimiter; wires Kotlin/VB extensions to their new filters.
embedding/commentfilter/kotlin_filter.go Implements Kotlin-aware comment filtering (nested block comments, raw strings, interpolation).
embedding/commentfilter/visual_basic_filter.go Implements Visual Basic-aware comment filtering (doc ''', apostrophe, and REM).
embedding/commentfilter/filter_test.go Adds/extends tests for Java text blocks, Kotlin raw strings/interpolation, and Visual Basic comment behavior.

…ent-filtering' into improve-java-comment-filtering
@Vladyslav-Kuksiuk Vladyslav-Kuksiuk marked this pull request as ready for review July 3, 2026 12:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants