Skip to content

Commit

Permalink
Polish
Browse files Browse the repository at this point in the history
  • Loading branch information
BoykoAlex committed Jun 5, 2024
1 parent 7a217dd commit 19754ed
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -109,13 +109,11 @@ protected IDocument acquireDocument(IProgressMonitor pm) throws CoreException {
final IDocument document = fBuffer.getDocument();
int offset = 0;
int length = document.getLength();
if (range != null) {
if (range != null && getEdit() == null) {
try {
offset = LSPEclipseUtils.toOffset(range.getStart(), document);
length = LSPEclipseUtils.toOffset(range.getEnd(), document) - offset;
if (getEdit() == null) {
this.setEdit(new ReplaceEdit(offset, length, newText));
}
this.setEdit(new ReplaceEdit(offset, length, newText));
} catch (BadLocationException e) {
// Should not happen
LanguageServerPlugin.logError(e);
Expand Down

0 comments on commit 19754ed

Please sign in to comment.