Skip to content

Check the preceding rune before recognizing conflict markers - #65464

Open
Jake Bailey (jakebailey) wants to merge 1 commit into
microsoft:mainfrom
jakebailey:compiler-fixes/conflict-markers
Open

Jake Bailey (jakebailey) wants to merge 1 commit into
microsoft:mainfrom
jakebailey:compiler-fixes/conflict-markers

Conversation

@jakebailey

Copy link
Copy Markdown
Member

Looking two bytes behind a marker can mistake inline text for a line boundary and miss Unicode line separators. Decode the rune ending at the marker instead, retaining the ASCII fast path.

Looking two bytes behind a marker can mistake inline text for a line
boundary and miss Unicode line separators. Decode the rune ending at
the marker instead, retaining the ASCII fast path.

Cover all marker kinds after line breaks, inline text, multibyte runes,
and invalid UTF-8 so recognition does not depend on byte width.
Copilot AI balanced review requested due to automatic review settings November 13, 2026 03:13
@github-project-automation github-project-automation Bot moved this to Not started in PR Backlog Nov 13, 2026
@typescript-automation typescript-automation Bot added Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug labels Nov 13, 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.

🟢 Approval recommended

The review reports no active issues with the conflict-marker detection change.

No open issues 🎉

What changed in this PR

This PR corrects conflict-marker detection in the TypeScript scanner by checking the rune immediately preceding a marker, while retaining the ASCII fast path.

Changes:

  • Fixes line-boundary detection for Unicode separators and inline text.
  • Adds regression tests covering line endings, intervening text, multibyte runes, and invalid UTF-8 across all four marker forms.
File Description
tsc/​internal/​scanner/​scanner.go Decodes the preceding rune at the correct boundary when needed.
tsc/​internal/​scanner/​scanner_test.go Adds table-driven tests for conflict-marker line-start detection.

Review effort: Balanced

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug

Projects

Status: Not started

Development

Successfully merging this pull request may close these issues.

2 participants