mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Do not expose change in createCompilerHost
This commit is contained in:
@@ -66,7 +66,12 @@ namespace ts {
|
||||
mtime: Date;
|
||||
}
|
||||
|
||||
export function createCompilerHost(options: CompilerOptions, setParentNodes?: boolean, system = sys): CompilerHost {
|
||||
export function createCompilerHost(options: CompilerOptions, setParentNodes?: boolean): CompilerHost {
|
||||
return createCompilerHostWorker(options, setParentNodes);
|
||||
}
|
||||
/*@internal*/
|
||||
// TODO(shkamat): update this after reworking ts build API
|
||||
export function createCompilerHostWorker(options: CompilerOptions, setParentNodes?: boolean, system = sys): CompilerHost {
|
||||
const existingDirectories = createMap<boolean>();
|
||||
|
||||
function getCanonicalFileName(fileName: string): string {
|
||||
|
||||
@@ -412,7 +412,7 @@ namespace ts {
|
||||
}
|
||||
|
||||
export function createSolutionBuilderHost(system = sys, reportDiagnostic?: DiagnosticReporter, reportSolutionBuilderStatus?: DiagnosticReporter) {
|
||||
const host = createCompilerHost({}, /*setParentNodes*/ undefined, system) as SolutionBuilderHost;
|
||||
const host = createCompilerHostWorker({}, /*setParentNodes*/ undefined, system) as SolutionBuilderHost;
|
||||
host.getModifiedTime = system.getModifiedTime ? path => system.getModifiedTime!(path) : () => undefined;
|
||||
host.setModifiedTime = system.setModifiedTime ? (path, date) => system.setModifiedTime!(path, date) : noop;
|
||||
host.deleteFile = system.deleteFile ? path => system.deleteFile!(path) : noop;
|
||||
|
||||
+1
-1
@@ -4105,7 +4105,7 @@ declare namespace ts {
|
||||
declare namespace ts {
|
||||
function findConfigFile(searchPath: string, fileExists: (fileName: string) => boolean, configName?: string): string | undefined;
|
||||
function resolveTripleslashReference(moduleName: string, containingFile: string): string;
|
||||
function createCompilerHost(options: CompilerOptions, setParentNodes?: boolean, system?: System): CompilerHost;
|
||||
function createCompilerHost(options: CompilerOptions, setParentNodes?: boolean): CompilerHost;
|
||||
function getPreEmitDiagnostics(program: Program, sourceFile?: SourceFile, cancellationToken?: CancellationToken): Diagnostic[];
|
||||
interface FormatDiagnosticsHost {
|
||||
getCurrentDirectory(): string;
|
||||
|
||||
+1
-1
@@ -4105,7 +4105,7 @@ declare namespace ts {
|
||||
declare namespace ts {
|
||||
function findConfigFile(searchPath: string, fileExists: (fileName: string) => boolean, configName?: string): string | undefined;
|
||||
function resolveTripleslashReference(moduleName: string, containingFile: string): string;
|
||||
function createCompilerHost(options: CompilerOptions, setParentNodes?: boolean, system?: System): CompilerHost;
|
||||
function createCompilerHost(options: CompilerOptions, setParentNodes?: boolean): CompilerHost;
|
||||
function getPreEmitDiagnostics(program: Program, sourceFile?: SourceFile, cancellationToken?: CancellationToken): Diagnostic[];
|
||||
interface FormatDiagnosticsHost {
|
||||
getCurrentDirectory(): string;
|
||||
|
||||
Reference in New Issue
Block a user