diff --git a/Jakefile b/Jakefile index 4ca4cf19600..433be9509c6 100644 --- a/Jakefile +++ b/Jakefile @@ -94,6 +94,7 @@ var definitionsRoots = [ "compiler/scanner.d.ts", "compiler/parser.d.ts", "compiler/checker.d.ts", + "compiler/program.d.ts", "services/services.d.ts", ]; diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 95f392f036b..e7bc88f4665 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -3,7 +3,7 @@ module ts { var nextSymbolId = 1; var nextNodeId = 1; - var nextMergeId = 1; + var nextMergeId = 1; /// fullTypeCheck denotes if this instance of the typechecker will be used to get semantic diagnostics. /// If fullTypeCheck === true, then the typechecker should do every possible check to produce all errors diff --git a/src/compiler/emitter.ts b/src/compiler/emitter.ts index d349a9b626d..621bf3c18a0 100644 --- a/src/compiler/emitter.ts +++ b/src/compiler/emitter.ts @@ -1462,6 +1462,17 @@ module ts { } } + export interface EmitHost extends ScriptReferenceHost { + getSourceFiles(): SourceFile[]; + isEmitBlocked(sourceFile?: SourceFile): boolean; + + getCommonSourceDirectory(): string; + getCanonicalFileName(fileName: string): string; + getNewLine(): string; + + writeFile(filename: string, data: string, writeByteOrderMark: boolean, onError?: (message: string) => void): void; + } + export function getDeclarationDiagnostics(host: EmitHost, resolver: EmitResolver, targetSourceFile: SourceFile): Diagnostic[] { var diagnostics: Diagnostic[] = []; var jsFilePath = getOwnEmitOutputFilePath(targetSourceFile, host, ".js"); diff --git a/src/compiler/types.ts b/src/compiler/types.ts index d606b40c0c8..05f57ad8214 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -906,6 +906,12 @@ module ts { identifiers: Map; } + export interface ScriptReferenceHost { + getCompilerOptions(): CompilerOptions; + getSourceFile(filename: string): SourceFile; + getCurrentDirectory(): string; + } + export interface Program extends ScriptReferenceHost { getSourceFiles(): SourceFile[]; getCompilerHost(): CompilerHost; @@ -972,24 +978,6 @@ module ts { getSourceFiles(): SourceFile[]; getSourceFile(filename: string): SourceFile; - //getSourceFiles(): SourceFile[]; - //getCompilerOptions(): CompilerOptions; - - //getDiagnostics(sourceFile?: SourceFile): Diagnostic[]; - //getGlobalDiagnostics(): Diagnostic[]; - //getDeclarationDiagnostics(sourceFile: SourceFile): Diagnostic[]; - - //// Gets a type checker that can be used to semantically analyze source fils in the program. - //// The 'produceDiagnostics' flag determines if the checker will produce diagnostics while - //// analyzing the code. It can be set to 'false' to make many type checking operaitons - //// faster. With this flag set, the checker can avoid codepaths only necessary to produce - //// diagnostics, but not necessary to answer semantic questions about the code. - //// - //// If 'produceDiagnostics' is false, then any calls to get diagnostics from the TypeChecker - //// will throw an invalid operation exception. - //getTypeChecker(produceDiagnostics: boolean): TypeChecker; - //getCommonSourceDirectory(): string; - //emitFiles(targetSourceFile?: SourceFile): EmitResult; } export interface TypeChecker { @@ -1100,23 +1088,6 @@ module ts { errorModuleName?: string // If the symbol is not visible from module, module's name } - export interface ScriptReferenceHost { - getCompilerOptions(): CompilerOptions; - getSourceFile(filename: string): SourceFile; - getCurrentDirectory(): string; - } - - export interface EmitHost extends ScriptReferenceHost { - getSourceFiles(): SourceFile[]; - isEmitBlocked(sourceFile?: SourceFile): boolean; - - getCommonSourceDirectory(): string; - getCanonicalFileName(fileName: string): string; - getNewLine(): string; - - writeFile(filename: string, data: string, writeByteOrderMark: boolean, onError?: (message: string) => void): void; - } - export interface EmitResolver { getLocalNameOfContainer(container: ModuleDeclaration | EnumDeclaration): string; getExpressionNamePrefix(node: Identifier): string;