From 1633e4abddcc3dd6ba92963e41cd250c26aeb423 Mon Sep 17 00:00:00 2001 From: Cyrus Najmabadi Date: Mon, 1 Dec 2014 16:26:34 -0800 Subject: [PATCH] Remove unnecessary diagnostic flag. --- src/compiler/parser.ts | 2 +- src/compiler/types.ts | 6 ------ src/services/formatting.ts | 4 ++-- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts index e6f57c6e7f3..44d44995937 100644 --- a/src/compiler/parser.ts +++ b/src/compiler/parser.ts @@ -1092,7 +1092,6 @@ module ts { : -1; if (start !== lastErrorPos) { var diagnostic = createFileDiagnostic(file, start, length, message, arg0, arg1, arg2); - diagnostic.isParseError = true; file.parseDiagnostics.push(diagnostic); } @@ -4190,6 +4189,7 @@ module ts { file.parseDiagnostics = []; file.grammarDiagnostics = []; file.semanticDiagnostics = []; + var referenceComments = processReferenceComments(); file.referencedFiles = referenceComments.referencedFiles; file.amdDependencies = referenceComments.amdDependencies; diff --git a/src/compiler/types.ts b/src/compiler/types.ts index f4fc13f76d9..6f737083efc 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -1277,12 +1277,6 @@ module ts { * Early error - any error (can be produced at parsing\binding\typechecking step) that blocks emit */ isEarly?: boolean; - /** - * Parse error - error produced by parser when it scanner returns a token - * that parser does not understand in its current state - * (as opposed to grammar error when parser can interpret the token but interpretation is not legal from the grammar perespective) - */ - isParseError?: boolean; } export enum DiagnosticCategory { diff --git a/src/services/formatting.ts b/src/services/formatting.ts index d986048cac3..741b853b7ba 100644 --- a/src/services/formatting.ts +++ b/src/services/formatting.ts @@ -192,7 +192,7 @@ module ts.formatting { // pick only errors that fall in range var sorted = errors - .filter(d => d.isParseError && rangeOverlapsWithStartEnd(originalRange, d.start, d.start + d.length)) + .filter(d => rangeOverlapsWithStartEnd(originalRange, d.start, d.start + d.length)) .sort((e1, e2) => e1.start - e2.start); if (!sorted.length) { @@ -252,7 +252,7 @@ module ts.formatting { rulesProvider: RulesProvider, requestKind: FormattingRequestKind): TextChange[] { - var rangeContainsError = prepareRangeContainsErrorFunction(sourceFile.getSyntacticDiagnostics(), originalRange); + var rangeContainsError = prepareRangeContainsErrorFunction(sourceFile.parseDiagnostics, originalRange); // formatting context is used by rules provider var formattingContext = new FormattingContext(sourceFile, requestKind);