Skip to content

Commit 156b598

Browse files
committed
Ensure that getProgramDiagnostic is included everywhere that getCompilerOptionsDiagnostic is
1 parent b0acdc3 commit 156b598

File tree

4 files changed

+26
-1
lines changed

4 files changed

+26
-1
lines changed

src/harness/client.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,10 @@ namespace ts.server {
392392
});
393393
}
394394

395+
getProgramDiagnostics(): Diagnostic[] {
396+
return this.getCompilerOptionsDiagnostics();
397+
}
398+
395399
getCompilerOptionsDiagnostics(): Diagnostic[] {
396400
return notImplemented();
397401
}

src/harness/harnessLanguageService.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -445,6 +445,9 @@ namespace Harness.LanguageService {
445445
getCompilerOptionsDiagnostics(): ts.Diagnostic[] {
446446
return unwrapJSONCallResult(this.shim.getCompilerOptionsDiagnostics());
447447
}
448+
getProgramDiagnostics(): ts.Diagnostic[] {
449+
return this.getCompilerOptionsDiagnostics();
450+
}
448451
getSyntacticClassifications(fileName: string, span: ts.TextSpan): ts.ClassifiedSpan[] {
449452
return unwrapJSONCallResult(this.shim.getSyntacticClassifications(fileName, span.start, span.length));
450453
}
@@ -520,7 +523,6 @@ namespace Harness.LanguageService {
520523
getNavigationTree(fileName: string): ts.NavigationTree {
521524
return unwrapJSONCallResult(this.shim.getNavigationTree(fileName));
522525
}
523-
524526
getOutliningSpans(fileName: string): ts.OutliningSpan[] {
525527
return unwrapJSONCallResult(this.shim.getOutliningSpans(fileName));
526528
}

src/services/shims.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ namespace ts {
143143
getSemanticDiagnostics(fileName: string): string;
144144
getSuggestionDiagnostics(fileName: string): string;
145145
getCompilerOptionsDiagnostics(): string;
146+
getProgramDiagnostics(): string;
146147

147148
getSyntacticClassifications(fileName: string, start: number, length: number): string;
148149
getSemanticClassifications(fileName: string, start: number, length: number): string;
@@ -734,6 +735,10 @@ namespace ts {
734735
return this.forwardJSONCall(`getSuggestionDiagnostics('${fileName}')`, () => this.realizeDiagnostics(this.languageService.getSuggestionDiagnostics(fileName)));
735736
}
736737

738+
public getProgramDiagnostics(): string {
739+
return this.getCompilerOptionsDiagnostics();
740+
}
741+
737742
public getCompilerOptionsDiagnostics(): string {
738743
return this.forwardJSONCall(
739744
"getCompilerOptionsDiagnostics()",
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// 35804
2+
3+
interface ITreeItem {
4+
Parent?: this;
5+
}
6+
7+
type NodeWithId = ITreeItem & { Id?: number };
8+
9+
function getMaxId(items: NodeWithId[]) {
10+
}
11+
12+
const nodes = [] as ITreeItem[];
13+
getMaxId(nodes);
14+

0 commit comments

Comments
 (0)