Remove unnecessary diagnostic flag.

This commit is contained in:
Cyrus Najmabadi 2014-12-01 16:26:34 -08:00
parent d730e5ca55
commit 1633e4abdd
3 changed files with 3 additions and 9 deletions

View File

@ -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;

View File

@ -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 {

View File

@ -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);