mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Use watch invoked with node_modules/.staging as watch for refreshing complete node_modules, so that npm install is reflected correctly (#36039)
* Add test that demonstrates npm install watch behaviour some times * Use watch invoked with `node_modules/.staging` as watch for refreshing complete node_modules, so that npm install is reflected correctly Fixes #35966
This commit is contained in:
@@ -1104,7 +1104,7 @@ namespace ts.server {
|
||||
this.host,
|
||||
directory,
|
||||
fileOrDirectory => {
|
||||
const fileOrDirectoryPath = this.toPath(fileOrDirectory);
|
||||
let fileOrDirectoryPath: Path | undefined = this.toPath(fileOrDirectory);
|
||||
const fsResult = project.getCachedDirectoryStructureHost().addOrDeleteFileOrDirectory(fileOrDirectory, fileOrDirectoryPath);
|
||||
|
||||
// don't trigger callback on open, existing files
|
||||
@@ -1115,7 +1115,8 @@ namespace ts.server {
|
||||
return;
|
||||
}
|
||||
|
||||
if (isPathIgnored(fileOrDirectoryPath)) return;
|
||||
fileOrDirectoryPath = removeIgnoredPath(fileOrDirectoryPath);
|
||||
if (!fileOrDirectoryPath) return;
|
||||
const configFilename = project.getConfigFilePath();
|
||||
|
||||
if (getBaseFileName(fileOrDirectoryPath) === "package.json" && !isInsideNodeModules(fileOrDirectoryPath) &&
|
||||
@@ -2272,8 +2273,8 @@ namespace ts.server {
|
||||
this.host,
|
||||
watchDir,
|
||||
(fileOrDirectory) => {
|
||||
const fileOrDirectoryPath = this.toPath(fileOrDirectory);
|
||||
if (isPathIgnored(fileOrDirectoryPath)) return;
|
||||
const fileOrDirectoryPath = removeIgnoredPath(this.toPath(fileOrDirectory));
|
||||
if (!fileOrDirectoryPath) return;
|
||||
|
||||
// Has extension
|
||||
Debug.assert(result.refCount > 0);
|
||||
|
||||
Reference in New Issue
Block a user