mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-27 12:04:04 +01:00
Also use relative pattern for watching markdown resources
This commit is contained in:
@@ -169,7 +169,7 @@ class MarkdownPreview extends Disposable implements WebviewResourceProvider {
|
||||
}
|
||||
}));
|
||||
|
||||
const watcher = this._register(vscode.workspace.createFileSystemWatcher(resource.fsPath));
|
||||
const watcher = this._register(vscode.workspace.createFileSystemWatcher(new vscode.RelativePattern(resource, '*')));
|
||||
this._register(watcher.onDidChange(uri => {
|
||||
if (this.isPreviewOf(uri)) {
|
||||
// Only use the file system event when VS Code does not already know about the file
|
||||
@@ -437,7 +437,7 @@ class MarkdownPreview extends Disposable implements WebviewResourceProvider {
|
||||
for (const src of srcs) {
|
||||
const uri = urlToUri(src, root);
|
||||
if (uri && !this._unwatchedImageSchemes.has(uri.scheme) && !this._fileWatchersBySrc.has(src)) {
|
||||
const watcher = vscode.workspace.createFileSystemWatcher(uri.fsPath);
|
||||
const watcher = vscode.workspace.createFileSystemWatcher(new vscode.RelativePattern(uri, '*'));
|
||||
watcher.onDidChange(() => {
|
||||
this.refresh(true);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user