-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Issue/34870 #35586
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue/34870 #35586
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you could also undo the unrelated whitespace changes, that'd be swell.
src/compiler/parser.ts
Outdated
if (token() !== SyntaxKind.CloseBraceToken) { | ||
const lastError = lastOrUndefined(parseDiagnostics); | ||
const start = scanner.getTokenPos(); | ||
if (!lastError || start !== lastError.start) { | ||
parseErrorAt(openBracePosition, openBracePosition + 1, Diagnostics.The_parser_expected_to_find_a_to_match_the_token_here); | ||
} | ||
} | ||
else { | ||
parseExpected(SyntaxKind.CloseBraceToken) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rather than this, since we want a related
span (not a change to the original span), consider:
if (!parseExpected(SyntaxKind.CloseBraceToken)) {
const lastError = lastOrUndefined(parseDiagnostics)!;
addRelatedInfo(lastError, createFileDiagnostic(sourceFile, openBracePosition, 1, Diagnostics.The_parser_expected_to_find_a_to_match_the_token_here));
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the quick response. I've introduced the requested changes and fixed the linting errors.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love it - cc @DanielRosenwasser for a review of the copy - once you're satisfied, give it a merge.
I love it too - thanks for the PR! |
Fixes #34870