Skip to content

Commit 23d0bae

Browse files
author
Andy Hanson
committed
Don't report suggestion diagnostics when a parse error exists
1 parent 66e9aaa commit 23d0bae

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

src/services/suggestionDiagnostics.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
/* @internal */
22
namespace ts {
33
export function computeSuggestionDiagnostics(sourceFile: SourceFile, program: Program, cancellationToken: CancellationToken): DiagnosticWithLocation[] {
4+
if (sourceFile.parseDiagnostics.length) {
5+
return emptyArray;
6+
}
7+
48
program.getSemanticDiagnostics(sourceFile, cancellationToken);
59
const diags: DiagnosticWithLocation[] = [];
610

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/// <reference path='fourslash.ts' />
2+
3+
// @Filename: /a.ts
4+
////export {};
5+
////const a = 1 d;
6+
7+
verify.getSuggestionDiagnostics([]);

0 commit comments

Comments
 (0)