Expose ts.Diagnostics to fourslash

This commit is contained in:
Andrew Branch 2019-05-22 10:00:09 -07:00
parent 52894cf850
commit ad9c36e0ec
No known key found for this signature in database
GPG key ID: 22CCA4B120C427D2
2 changed files with 18 additions and 1 deletions

View file

@ -42,6 +42,8 @@
//
// TODO: figure out a better solution to the API exposure problem.
/// <reference path="../../../src/compiler/diagnosticInformationMap.generated.ts" />
declare module ts {
export type MapKey = string | number;
export interface Map<T> {
@ -70,6 +72,21 @@ declare module ts {
text: string;
}
enum DiagnosticCategory {
Warning,
Error,
Suggestion,
Message
}
interface DiagnosticMessage {
key: string;
category: DiagnosticCategory;
code: number;
message: string;
reportsUnnecessary?: {};
}
function flatMap<T, U>(array: ReadonlyArray<T>, mapfn: (x: T, i: number) => U | ReadonlyArray<U> | undefined): U[];
}

View file

@ -6,7 +6,7 @@
////const b = <div x={<div />[|x|]} />
test.ranges().forEach(range => {
verify.errorExistsAtRange(range, 1005, "'}' expected.");
verify.errorExistsAtRange(range, ts.Diagnostics._0_expected.code, "'}' expected.");
// This is just to ensure getting quick info doesnt crash
verify.not.quickInfoExists();
});