提交 bafcdc68 编写于 作者: B Benjamin Pasero

fix #44957

上级 72dc9967
......@@ -12,6 +12,7 @@ import { IDisposable, dispose, toDisposable } from 'vs/base/common/lifecycle';
import Event, { Emitter } from 'vs/base/common/event';
import * as json from 'vs/base/common/json';
import * as extfs from 'vs/base/node/extfs';
import { isWindows } from 'vs/base/common/platform';
export interface IConfigurationChangeEvent<T> {
config: T;
......@@ -165,8 +166,18 @@ export class ConfigWatcher<T> implements IConfigWatcher<T>, IDisposable {
}
private onConfigFileChange(eventType: string, filename: string, isParentFolder: boolean): void {
if (isParentFolder && filename !== this.configName) {
return; // a change to a sibling file that is not our config file
if (isParentFolder) {
// Windows: in some cases the filename contains artifacts from the absolute path
// see https://github.com/nodejs/node/issues/19170
// As such, we have to ensure that the filename basename is used for comparison.
if (isWindows && filename !== this.configName) {
filename = basename(filename);
}
if (filename !== this.configName) {
return; // a change to a sibling file that is not our config file
}
}
if (this.timeoutHandle) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册