Use relativepattern for file watcher

For #143291
This commit is contained in:
Matt Bierner 2022-02-22 08:45:42 -08:00
parent 46301339b7
commit 1678c27fcd
No known key found for this signature in database
GPG key ID: 099C331567E11888

View file

@ -143,7 +143,7 @@ class Preview extends Disposable {
this._previewState = PreviewState.Disposed;
}));
const watcher = this._register(vscode.workspace.createFileSystemWatcher(resource.fsPath));
const watcher = this._register(vscode.workspace.createFileSystemWatcher(new vscode.RelativePattern(resource, '*')));
this._register(watcher.onDidChange(e => {
if (e.toString() === this.resource.toString()) {
this.render();