Skip to content

Commit

Permalink
Avoid assertion failure
Browse files Browse the repository at this point in the history
  • Loading branch information
BoykoAlex committed Jun 4, 2024
1 parent beb9363 commit 7b4b699
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,9 @@ protected IDocument acquireDocument(IProgressMonitor pm) throws CoreException {
try {
offset = LSPEclipseUtils.toOffset(range.getStart(), document);
length = LSPEclipseUtils.toOffset(range.getEnd(), document) - offset;
this.setEdit(new ReplaceEdit(offset, length, newText));
if (getEdit() == null) {
this.setEdit(new ReplaceEdit(offset, length, newText));
}
} catch (BadLocationException e) {
// Should not happen
LanguageServerPlugin.logError(e);
Expand Down

0 comments on commit 7b4b699

Please sign in to comment.