Skip to content

Commit

Permalink
Removed redundant tracking of document renamings
Browse files Browse the repository at this point in the history
  • Loading branch information
huddeldaddel authored and barmac committed Sep 20, 2024
1 parent a4acc73 commit c494f70
Showing 1 changed file with 1 addition and 17 deletions.
18 changes: 1 addition & 17 deletions src/bpmn-editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -351,14 +351,10 @@ export class BpmnEditor implements vscode.CustomEditorProvider<BpmnDocument> {

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;
Expand Down Expand Up @@ -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)) {
Expand Down

0 comments on commit c494f70

Please sign in to comment.