From c494f704cca444de1d048c14a09f3c27a9df3b5d Mon Sep 17 00:00:00 2001 From: Thomas Werner <35447824+huddeldaddel@users.noreply.github.com> Date: Tue, 17 Sep 2024 21:40:45 +0200 Subject: [PATCH] Removed redundant tracking of document renamings --- src/bpmn-editor.ts | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/src/bpmn-editor.ts b/src/bpmn-editor.ts index 2cbf15b..7c04b17 100644 --- a/src/bpmn-editor.ts +++ b/src/bpmn-editor.ts @@ -351,14 +351,10 @@ export class BpmnEditor implements vscode.CustomEditorProvider { document.onDidDispose(() => disposeAll(listeners)); - // track documents across rename and deletion + // track documents this.documents.add(uri, document); - document.onDidRename(e => { - this.documents.rename(e.oldUri, e.newUri); - }); - document.onDidDispose(() => this.documents.remove(document.uri)); return document; @@ -540,18 +536,6 @@ class DocumentCollection { return this._documents.delete(key); } - rename(oldUri: vscode.Uri, newUri: vscode.Uri) { - - const document = this.get(oldUri); - - if (!document) { - throw new Error('document not found'); - } - - this.remove(oldUri); - this.add(newUri, document); - } - add(uri: vscode.Uri, document: BpmnDocument) { if (this.get(uri)) {