Skip to content

Fix semicolon hints after Unicode line separators - #65527

Closed
lavudya santhosh (pawangopallavudya-commits) wants to merge 2 commits into
microsoft:mainfrom
pawangopallavudya-commits:fix/asi-unicode-line-separators
Closed

lavudya santhosh (pawangopallavudya-commits) wants to merge 2 commits into
microsoft:mainfrom
pawangopallavudya-commits:fix/asi-unicode-line-separators

Conversation

@pawangopallavudya-commits

Summary

When a call expression follows U+2028 or U+2029, the checker misses the related “Are you missing a semicolon?” diagnostic because SkipTriviaEx does not stop after those ECMAScript line terminators. It also inspects the last UTF-8 byte instead of decoding the rune.

Teach SkipTriviaEx to stop after U+2028 and U+2029, and decode the last rune when deciding whether to add the hint. Add regression coverage for both separators.

Fixes #65433

Tests

  • PASS: focused compiler test, go -C ./tsc test -run='TestLocal/betterErrorForAccidentalCall' ./internal/testrunner.
  • Full lint and format checks were not run.

Assisted-by: Codex (GPT-6).

Copilot AI balanced review requested due to automatic review settings November 16, 2026 16:14
@github-project-automation github-project-automation Bot moved this to Not started in PR Backlog Nov 16, 2026
@typescript-automation typescript-automation Bot added the For Backlog Bug PRs that fix a backlog bug label Nov 16, 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

No active review issues block the fix restoring semicolon hints after Unicode line and paragraph separators.

No open issues 🎉

What changed in this PR

Fixes #65433 by restoring the compiler’s “Are you missing a semicolon?” hint when an accidental call follows a Unicode line or paragraph separator.

Changes:

  • Make SkipTriviaEx stop after U+2028 and U+2029 when requested.
  • Decode the preceding UTF-8 rune when checking for a line break.
  • Add regression cases for both separators and update expected baselines.
File Description
tsc/​testdata/​tests/​cases/​compiler/​betterErrorForAccidentalCall.ts Adds regression cases for both Unicode separators.
tsc/​testdata/​baselines/​reference/​compiler/​betterErrorForAccidentalCall.types Records types for the new cases.
tsc/​testdata/​baselines/​reference/​compiler/​betterErrorForAccidentalCall.symbols Records symbols for the new cases.
tsc/​testdata/​baselines/​reference/​compiler/​betterErrorForAccidentalCall.js Records emitted JavaScript for the new cases.
tsc/​testdata/​baselines/​reference/​compiler/​betterErrorForAccidentalCall.errors.txt Records the expected semicolon hints.
tsc/​internal/​scanner/​scanner.go Handles Unicode separators in stop-after-line-break scanning.
tsc/​internal/​checker/​checker.go Decodes the last rune before deciding whether to add the hint.

Review effort: Balanced

@github-project-automation github-project-automation Bot moved this from Not started to Done in PR Backlog Nov 16, 2026
@pawangopallavudya-commits

Copy link
Copy Markdown
Author

Hi Ryan,

I noticed that PR #65527 was closed without being merged. I would appreciate understanding the reason for the closure.

Was there an issue with the proposed implementation, or was the fix no longer needed?

I'd be happy to make any necessary changes based on your feedback.

Thank you!

@RyanCavanaugh

Copy link
Copy Markdown
Member

lavudya santhosh (@pawangopallavudya-commits) read the issue that you are fixing...

@pawangopallavudya-commits
lavudya santhosh (pawangopallavudya-commits) deleted the fix/asi-unicode-line-separators branch November 18, 2026 01:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

For Backlog Bug PRs that fix a backlog bug

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Incorrect error message when ASI errors involve a nonstandard newline

3 participants