Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f1aa06f

Browse files
Revert the change to parseErrorAtPosition in parser.ts
The change is no longer necessary since it’s moved to `checker.ts` in microsoft#58295. The partially reverts microsoft@1a5228d.
1 parent a7621e0 commit f1aa06f

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

src/compiler/parser.ts

+1-6
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ import {
6262
DeleteExpression,
6363
Diagnostic,
6464
DiagnosticArguments,
65-
DiagnosticCategory,
6665
DiagnosticMessage,
6766
Diagnostics,
6867
DiagnosticWithDetachedLocation,
@@ -2144,11 +2143,7 @@ namespace Parser {
21442143
// Don't report another error if it would just be at the same position as the last error.
21452144
const lastError = lastOrUndefined(parseDiagnostics);
21462145
let result: DiagnosticWithDetachedLocation | undefined;
2147-
if (message.category === DiagnosticCategory.Message && lastError && start === lastError.start && length === lastError.length) {
2148-
result = createDetachedDiagnostic(fileName, sourceText, start, length, message, ...args);
2149-
addRelatedInfo(lastError, result);
2150-
}
2151-
else if (!lastError || start !== lastError.start) {
2146+
if (!lastError || start !== lastError.start) {
21522147
result = createDetachedDiagnostic(fileName, sourceText, start, length, message, ...args);
21532148
parseDiagnostics.push(result);
21542149
}

0 commit comments

Comments
 (0)