Skip to content

Check the preceding rune before recognizing conflict markers - #65464

Merged
Jake Bailey (jakebailey) merged 1 commit into
microsoft:mainfrom
jakebailey:compiler-fixes/conflict-markers
Nov 17, 2026
Merged

Jake Bailey (jakebailey) merged 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

@jakebailey
Jake Bailey (jakebailey) added this pull request to the merge queue Nov 17, 2026
@github-project-automation github-project-automation Bot moved this from Not started to Needs merge in PR Backlog Nov 17, 2026
Merged via the queue into microsoft:main with commit aaca0a4 Nov 17, 2026
34 checks passed
@jakebailey
Jake Bailey (jakebailey) deleted the compiler-fixes/conflict-markers branch November 17, 2026 21:35
@github-project-automation github-project-automation Bot moved this from Needs merge to Done in PR Backlog Nov 17, 2026
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: Done

Development

Successfully merging this pull request may close these issues.

3 participants