Handle extra file extensions when wild card directory watch is invoked (#41018)

Fixes #40495
This commit is contained in:
Sheetal Nandi 2020-10-09 14:07:55 -07:00 committed by GitHub
parent 4766a2e5a3
commit 876e44bbc6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 1 deletions

View file

@ -635,7 +635,7 @@ namespace ts {
function reloadFileNamesFromConfigFile() {
writeLog("Reloading new file names and options");
const result = getFileNamesFromConfigSpecs(configFileSpecs, getNormalizedAbsolutePath(getDirectoryPath(configFileName), currentDirectory), compilerOptions, parseConfigFileHost);
const result = getFileNamesFromConfigSpecs(configFileSpecs, getNormalizedAbsolutePath(getDirectoryPath(configFileName), currentDirectory), compilerOptions, parseConfigFileHost, extraFileExtensions);
if (updateErrorForNoInputFiles(result, getNormalizedAbsolutePath(configFileName, currentDirectory), configFileSpecs, configFileParsingDiagnostics!, canConfigFileJsonReportNoInputFiles)) {
hasChangedConfigFileParsingErrors = true;
}
@ -748,6 +748,7 @@ namespace ts {
fileOrDirectoryPath,
configFileName,
configFileSpecs,
extraFileExtensions,
options: compilerOptions,
program: getCurrentBuilderProgram(),
currentDirectory,

View file

@ -121,6 +121,11 @@ namespace ts.tscWatch {
);
const watch = createWatchProgram(watchCompilerHost);
checkProgramActualFiles(watch.getProgram().getProgram(), [mainFile.path, otherFile.path, libFile.path]);
const other2 = `${projectRoot}/other2.vue`;
sys.writeFile(other2, otherFile.content);
checkSingleTimeoutQueueLengthAndRun(sys);
checkProgramActualFiles(watch.getProgram().getProgram(), [mainFile.path, otherFile.path, libFile.path, other2]);
});
});
}