Skip to content

Improve Go comments filtering#94

Open
Vladyslav-Kuksiuk wants to merge 2 commits into
masterfrom
improve-go-filtering
Open

Improve Go comments filtering#94
Vladyslav-Kuksiuk wants to merge 2 commits into
masterfrom
improve-go-filtering

Conversation

@Vladyslav-Kuksiuk

Copy link
Copy Markdown
Collaborator

This PR improves Go comments filtering.

Resolves this issue.

@Vladyslav-Kuksiuk Vladyslav-Kuksiuk self-assigned this Jul 6, 2026
@Vladyslav-Kuksiuk Vladyslav-Kuksiuk marked this pull request as ready for review July 6, 2026 13:22
Base automatically changed from improve-tests to master July 6, 2026 14:38
@Oleg-Melnik

Oleg-Melnik commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator

Claude Review

LGTM — nothing blocking found.

Checked and confirmed clean:

  • The Escapes distinction is semantically right: Go raw strings have no escapes, so the first backtick always closes — the old shared textBlockEnd would have mis-skipped on `C:\Users\` (the backslash-skip consumed the closing delimiter). Java text blocks do honor \", preserved via Escapes: true. Both now match their language specs.
  • Scan order stays safe: consumeTextBlockStart runs before consumeQuotedSegment, so Java's """ still wins over ""+" disambiguation, and Go's backtick no longer collides since it was removed from goQuoteChars.
  • Multi-line state: textBlockActive/textBlock persist across lines via blockState; unterminated-at-EOL writes the remainder and continues on the next line — the new multi-line test exercises exactly this.
  • Removed behavior: dropping the backtick from Go's quote chars removes the old (incorrect) single-line escape-processing path — its replacement is strictly better. No syntax besides Java and Go used TextBlocks, so the []string[]TextBlockMarker change is fully covered.
  • Edge cases hold: trailing backslash at end of line in an escaping block (cursor overshoot exits the loop cleanly, state stays active); escaped quotes before potential delimiters; "" adjacent to text; prefixFrom is still live via prefixAt (no dead code).

One micro-nit, take or leave: goQuoteChars = "\"'" duplicates the literal Java already uses inline for its QuoteChars — a single shared const (e.g. cLikeQuoteChars) would cover both. Purely cosmetic.

@Oleg-Melnik Oleg-Melnik left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@Vladyslav-Kuksiuk LGTM with minor comment from Claude.

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.

Add Go raw string support to comment filtering

3 participants