-
Notifications
You must be signed in to change notification settings - Fork 13k
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptFixedA PR has been merged for this issueA PR has been merged for this issue
Milestone
Description
Generated definitions in bin/typescriptServices_internal.d.ts are invalid, causing compilation error if used:
typescriptServices_internal.d.ts 2304 @272:43 Cannot find name 'DiagnosticCollection'
declare module ts {
// ...
function createDiagnosticCollection(): DiagnosticCollection;
This is because DiagnosticCollection is defined with @internal flag in src/compiler/types.ts:
module ts {
// ...
// @internal
export interface DiagnosticCollection {
// Adds a diagnostic to this diagnostic collection.
add(diagnostic: Diagnostic): void;
// Gets all the diagnostics that aren't associated with a file.
getGlobalDiagnostics(): Diagnostic[];
// If fileName is provided, gets all the diagnostics associated with that file name.
// Otherwise, returns all the diagnostics (global and file associated) in this colletion.
getDiagnostics(fileName?: string): Diagnostic[];
// Gets a count of how many times this collection has been modified. This value changes
// each time 'add' is called (regardless of whether or not an equivalent diagnostic was
// already in the collection). As such, it can be used as a simple way to tell if any
// operation caused diagnostics to be returned by storing and comparing the return value
// of this method before/after the operation is performed.
getModificationCount(): number;
}
The interface looks internal enough, so I guess ts.createDiagnosticCollection() function should go under the internal flag together with the interface.
Also there need to be tests for the validity of all the generated d.ts files, shouldn't there?
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptFixedA PR has been merged for this issueA PR has been merged for this issue