Skip to content

Commit

Permalink
fix: fix crash when "Save as" is used
Browse files Browse the repository at this point in the history
Closes #176
  • Loading branch information
huddeldaddel authored Sep 23, 2024
1 parent a4acc73 commit 998f30b
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 998f30b

Please sign in to comment.