Repository navigation
Fix semicolon hints after Unicode line separators - #65527
Closed
lavudya santhosh (pawangopallavudya-commits) wants to merge 2 commits into
Closed
lavudya santhosh (pawangopallavudya-commits) wants to merge 2 commits into
lavudya santhosh (pawangopallavudya-commits) wants to merge 2 commits into
Conversation
Copilot started reviewing on behalf of
lavudya santhosh (pawangopallavudya-commits)
November 16, 2026 16:16
Contributor
There was a problem hiding this comment.
🟢 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
SkipTriviaExstop 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
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! |
Member
|
lavudya santhosh (@pawangopallavudya-commits) read the issue that you are fixing... |
lavudya santhosh (pawangopallavudya-commits)
deleted the
fix/asi-unicode-line-separators
branch
November 18, 2026 01:46
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
go -C ./tsc test -run='TestLocal/betterErrorForAccidentalCall' ./internal/testrunner.Assisted-by: Codex (GPT-6).