mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-20 16:49:06 +01:00
@@ -110,15 +110,17 @@ class MarkdownPreview extends Disposable implements WebviewResourceProvider {
|
||||
}
|
||||
}));
|
||||
|
||||
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
|
||||
if (!vscode.workspace.textDocuments.some(doc => doc.uri.toString() === uri.toString())) {
|
||||
this.refresh();
|
||||
if (vscode.workspace.fs.isWritableFileSystem(resource.scheme)) {
|
||||
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
|
||||
if (!vscode.workspace.textDocuments.some(doc => doc.uri.toString() === uri.toString())) {
|
||||
this.refresh();
|
||||
}
|
||||
}
|
||||
}
|
||||
}));
|
||||
}));
|
||||
}
|
||||
|
||||
this._register(this._webviewPanel.webview.onDidReceiveMessage((e: FromWebviewMessage.Type) => {
|
||||
if (e.source !== this._resource.toString()) {
|
||||
|
||||
Reference in New Issue
Block a user