Skip to content

Commit

Permalink
fix: now annotations would clear for modes without corresponding service
Browse files Browse the repository at this point in the history
  • Loading branch information
mkslanc committed Mar 19, 2024
1 parent 3366763 commit 1d71763
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/ace-linters/src/language-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,12 @@ class SessionLanguageProvider {
return;
}
this.$deltaQueue = [];

this.session.clearAnnotations();
if (this.state.diagnosticMarkers) {
this.state.diagnosticMarkers.setMarkers([]);
}

this.$messageController.changeMode(this.fileName, this.session.getValue(), this.$mode, this.setServerCapabilities);
};

Expand Down Expand Up @@ -536,6 +542,7 @@ class SessionLanguageProvider {
}

private $applyFormat = (edits: lsp.TextEdit[]) => {
edits ??= [];
for (let edit of edits.reverse()) {
this.session.replace(<Ace.Range>toRange(edit.range), edit.newText);
}
Expand Down

0 comments on commit 1d71763

Please sign in to comment.