mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-12 21:37:41 -06:00
Rename getProgram to getExistingProgram
This commit is contained in:
parent
374536ba32
commit
3dda2179e8
@ -214,9 +214,9 @@ namespace ts {
|
||||
export interface Watch {
|
||||
/** Synchronize the program with the changes */
|
||||
synchronizeProgram(): void;
|
||||
/** Get current program */
|
||||
/** Gets the existing program without synchronizing with changes on host */
|
||||
/*@internal*/
|
||||
getProgram(): Program;
|
||||
getExistingProgram(): Program;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -360,8 +360,8 @@ namespace ts {
|
||||
watchConfigFileWildCardDirectories();
|
||||
|
||||
return configFileName ?
|
||||
{ getProgram: () => program, synchronizeProgram } :
|
||||
{ getProgram: () => program, synchronizeProgram, updateRootFileNames };
|
||||
{ getExistingProgram: () => program, synchronizeProgram } :
|
||||
{ getExistingProgram: () => program, synchronizeProgram, updateRootFileNames };
|
||||
|
||||
function synchronizeProgram() {
|
||||
writeLog(`Synchronizing program`);
|
||||
|
||||
@ -897,12 +897,12 @@ namespace ts {
|
||||
}
|
||||
|
||||
function verifyProgramWithoutConfigFile(system: System, rootFiles: string[], options: CompilerOptions) {
|
||||
const program = createWatchOfFilesAndCompilerOptions(rootFiles, options, system).getProgram();
|
||||
const program = createWatchOfFilesAndCompilerOptions(rootFiles, options, system).getExistingProgram();
|
||||
verifyProgramIsUptoDate(program, duplicate(rootFiles), duplicate(options));
|
||||
}
|
||||
|
||||
function verifyProgramWithConfigFile(system: System, configFileName: string) {
|
||||
const program = createWatchOfConfigFile(configFileName, {}, system).getProgram();
|
||||
const program = createWatchOfConfigFile(configFileName, {}, system).getExistingProgram();
|
||||
const { fileNames, options } = parseConfigFile(configFileName, {}, system, notImplemented);
|
||||
verifyProgramIsUptoDate(program, fileNames, options);
|
||||
}
|
||||
|
||||
@ -24,12 +24,12 @@ namespace ts.tscWatch {
|
||||
|
||||
function createWatchOfConfigFile(configFileName: string, host: WatchedSystem) {
|
||||
const watch = ts.createWatchOfConfigFile(configFileName, {}, host);
|
||||
return () => watch.getProgram();
|
||||
return () => watch.getExistingProgram();
|
||||
}
|
||||
|
||||
function createWatchOfFilesAndCompilerOptions(rootFiles: string[], host: WatchedSystem, options: CompilerOptions = {}) {
|
||||
const watch = ts.createWatchOfFilesAndCompilerOptions(rootFiles, options, host);
|
||||
return () => watch.getProgram();
|
||||
return () => watch.getExistingProgram();
|
||||
}
|
||||
|
||||
function getEmittedLineForMultiFileOutput(file: FileOrFolder, host: WatchedSystem) {
|
||||
@ -237,8 +237,8 @@ namespace ts.tscWatch {
|
||||
const host = createWatchedSystem([configFile, libFile, file1, file2, file3]);
|
||||
const watch = ts.createWatchOfConfigFile(configFile.path, {}, host, notImplemented);
|
||||
|
||||
checkProgramActualFiles(watch.getProgram(), [file1.path, libFile.path, file2.path]);
|
||||
checkProgramRootFiles(watch.getProgram(), [file1.path, file2.path]);
|
||||
checkProgramActualFiles(watch.getExistingProgram(), [file1.path, libFile.path, file2.path]);
|
||||
checkProgramRootFiles(watch.getExistingProgram(), [file1.path, file2.path]);
|
||||
checkWatchedFiles(host, [configFile.path, file1.path, file2.path, libFile.path]);
|
||||
const configDir = getDirectoryPath(configFile.path);
|
||||
checkWatchedDirectories(host, [configDir, combinePaths(configDir, projectSystem.nodeModulesAtTypes)], /*recursive*/ true);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user