From 7b4b699722a739bf47d1628fbef57eb55bf97647 Mon Sep 17 00:00:00 2001 From: aboyko Date: Mon, 3 Jun 2024 21:34:00 -0400 Subject: [PATCH 1/4] Avoid assertion failure --- .../src/org/eclipse/lsp4e/refactoring/LSPTextChange.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/org.eclipse.lsp4e/src/org/eclipse/lsp4e/refactoring/LSPTextChange.java b/org.eclipse.lsp4e/src/org/eclipse/lsp4e/refactoring/LSPTextChange.java index fb528058a..e3774681d 100644 --- a/org.eclipse.lsp4e/src/org/eclipse/lsp4e/refactoring/LSPTextChange.java +++ b/org.eclipse.lsp4e/src/org/eclipse/lsp4e/refactoring/LSPTextChange.java @@ -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); From dd2cf2f44ab0a38c4d1b0448e7ba71f9ed113bd7 Mon Sep 17 00:00:00 2001 From: aboyko Date: Mon, 3 Jun 2024 21:40:53 -0400 Subject: [PATCH 2/4] Bump qualifier --- org.eclipse.lsp4e/META-INF/MANIFEST.MF | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/org.eclipse.lsp4e/META-INF/MANIFEST.MF b/org.eclipse.lsp4e/META-INF/MANIFEST.MF index 787977d64..77b4cca30 100644 --- a/org.eclipse.lsp4e/META-INF/MANIFEST.MF +++ b/org.eclipse.lsp4e/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Language Server Protocol client for Eclipse IDE (Incubation) Bundle-SymbolicName: org.eclipse.lsp4e;singleton:=true -Bundle-Version: 0.18.10.qualifier +Bundle-Version: 0.18.11.qualifier Bundle-RequiredExecutionEnvironment: JavaSE-17 Require-Bundle: org.eclipse.core.runtime;bundle-version="3.12.0", org.eclipse.equinox.common;bundle-version="3.8.0", From 7a217dd5229d58214b5b85afbf11aef9536b73d2 Mon Sep 17 00:00:00 2001 From: aboyko Date: Mon, 3 Jun 2024 21:45:39 -0400 Subject: [PATCH 3/4] Match bundle version in pom --- org.eclipse.lsp4e/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/org.eclipse.lsp4e/pom.xml b/org.eclipse.lsp4e/pom.xml index 3411057b5..597f76d7b 100644 --- a/org.eclipse.lsp4e/pom.xml +++ b/org.eclipse.lsp4e/pom.xml @@ -10,7 +10,7 @@ org.eclipse.lsp4e eclipse-plugin - 0.18.10-SNAPSHOT + 0.18.11-SNAPSHOT From 19754ede10845a45f5aecb229ed677b92545f6f7 Mon Sep 17 00:00:00 2001 From: aboyko Date: Wed, 5 Jun 2024 11:42:40 -0400 Subject: [PATCH 4/4] Polish --- .../src/org/eclipse/lsp4e/refactoring/LSPTextChange.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/org.eclipse.lsp4e/src/org/eclipse/lsp4e/refactoring/LSPTextChange.java b/org.eclipse.lsp4e/src/org/eclipse/lsp4e/refactoring/LSPTextChange.java index e3774681d..5f1deeb6e 100644 --- a/org.eclipse.lsp4e/src/org/eclipse/lsp4e/refactoring/LSPTextChange.java +++ b/org.eclipse.lsp4e/src/org/eclipse/lsp4e/refactoring/LSPTextChange.java @@ -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);