Refactor and add wildcard scenario

This commit is contained in:
Benjamin Lichtman
2019-05-31 11:24:54 -07:00
parent 6b92ccaffa
commit 7ac5fa783b
4 changed files with 34 additions and 6 deletions

View File

@@ -1002,7 +1002,13 @@ namespace ts.server {
directory,
fileOrDirectory => {
const fileOrDirectoryPath = this.toPath(fileOrDirectory);
project.getCachedDirectoryStructureHost().addOrDeleteFileOrDirectory(fileOrDirectory, fileOrDirectoryPath);
const fileSystemResult = project.getCachedDirectoryStructureHost().addOrDeleteFileOrDirectory(fileOrDirectory, fileOrDirectoryPath);
// don't trigger callback on open, existing files
if (project.fileIsOpen(fileOrDirectoryPath) && fileSystemResult && fileSystemResult.fileExists) {
return;
}
if (isPathIgnored(fileOrDirectoryPath)) return;
const configFilename = project.getConfigFilePath();