-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Add type for diagnostics where location is defined #23686
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
0301fed
7ade816
919cfc0
b372285
919cb05
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,12 +1,12 @@ | ||
| /*@internal*/ | ||
| namespace ts { | ||
| export function getDeclarationDiagnostics(host: EmitHost, resolver: EmitResolver, file: SourceFile | undefined): Diagnostic[] { | ||
| export function getDeclarationDiagnostics(host: EmitHost, resolver: EmitResolver, file: SourceFile | undefined): DiagnosticWithLocation[] { | ||
| if (file && isSourceFileJavaScript(file)) { | ||
| return []; // No declaration diagnostics for js for now | ||
| } | ||
| const compilerOptions = host.getCompilerOptions(); | ||
| const result = transformNodes(resolver, host, compilerOptions, file ? [file] : filter(host.getSourceFiles(), isSourceFileNotJavaScript), [transformDeclarations], /*allowDtsFiles*/ false); | ||
| return result.diagnostics; | ||
| return result.diagnostics as DiagnosticWithLocation[]; // TODO: GH#18217 | ||
|
||
| } | ||
|
|
||
| const declarationEmitNodeBuilderFlags = NodeBuilderFlags.MultilineObjectLiterals | TypeFormatFlags.WriteClassExpressionAsTypeLiteral | NodeBuilderFlags.UseTypeOfFunction | NodeBuilderFlags.UseStructuralFallback | NodeBuilderFlags.AllowEmptyTuple; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here we are asking for diagnostics for a particular file. But
getDiagnosticsinchecker.tsseems to add global diagnostics in some cases. @rbuckton Do you know how this works?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if you are missing some of the built in types like
Arrayfor instance, that is a global diagnostic.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As @mhegazy said. We add those only when they are first requested.