diff --git a/org.eclipse.lsp4e.debug/META-INF/MANIFEST.MF b/org.eclipse.lsp4e.debug/META-INF/MANIFEST.MF
index a6b57c107..ac0147c2f 100644
--- a/org.eclipse.lsp4e.debug/META-INF/MANIFEST.MF
+++ b/org.eclipse.lsp4e.debug/META-INF/MANIFEST.MF
@@ -3,16 +3,16 @@ Bundle-ManifestVersion: 2
Bundle-Name: Debug Adapter client for Eclipse IDE (Incubation)
Bundle-SymbolicName: org.eclipse.lsp4e.debug;singleton:=true
Bundle-Vendor: Eclipse LSP4E
-Bundle-Version: 0.16.1.qualifier
+Bundle-Version: 0.16.2.qualifier
Bundle-Activator: org.eclipse.lsp4e.debug.DSPPlugin
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
org.eclipse.debug.core,
org.eclipse.debug.ui,
org.eclipse.jface,
- org.eclipse.lsp4j.jsonrpc;bundle-version="[0.24.0,0.25.0)",
- org.eclipse.lsp4j.jsonrpc.debug;bundle-version="[0.24.0,0.25.0)",
- org.eclipse.lsp4j.debug;bundle-version="[0.24.0,0.25.0)",
+ org.eclipse.lsp4j.jsonrpc;bundle-version="[1.0.0,2.0.0)",
+ org.eclipse.lsp4j.jsonrpc.debug;bundle-version="[1.0.0,2.0.0)",
+ org.eclipse.lsp4j.debug;bundle-version="[1.0.0,2.0.0)",
org.eclipse.ui.editors,
org.eclipse.core.filesystem,
org.eclipse.ui.ide;bundle-version="[3.16.0,4.0.0)",
diff --git a/org.eclipse.lsp4e.test/META-INF/MANIFEST.MF b/org.eclipse.lsp4e.test/META-INF/MANIFEST.MF
index 6369d95b0..4bdbc8c30 100644
--- a/org.eclipse.lsp4e.test/META-INF/MANIFEST.MF
+++ b/org.eclipse.lsp4e.test/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Tests for language server bundle (Incubation)
Bundle-SymbolicName: org.eclipse.lsp4e.test;singleton:=true
-Bundle-Version: 0.16.4.qualifier
+Bundle-Version: 0.16.5.qualifier
Fragment-Host: org.eclipse.lsp4e
Bundle-Vendor: Eclipse LSP4E
Bundle-RequiredExecutionEnvironment: JavaSE-21
diff --git a/org.eclipse.lsp4e.test/pom.xml b/org.eclipse.lsp4e.test/pom.xml
index c87cf3093..50051a8b9 100644
--- a/org.eclipse.lsp4e.test/pom.xml
+++ b/org.eclipse.lsp4e.test/pom.xml
@@ -8,7 +8,7 @@
org.eclipse.lsp4e.test
eclipse-test-plugin
- 0.16.4-SNAPSHOT
+ 0.16.5-SNAPSHOT
diff --git a/org.eclipse.lsp4e.test/src/org/eclipse/lsp4e/test/diagnostics/DiagnosticsTest.java b/org.eclipse.lsp4e.test/src/org/eclipse/lsp4e/test/diagnostics/DiagnosticsTest.java
index f6674f003..40dcaddac 100644
--- a/org.eclipse.lsp4e.test/src/org/eclipse/lsp4e/test/diagnostics/DiagnosticsTest.java
+++ b/org.eclipse.lsp4e.test/src/org/eclipse/lsp4e/test/diagnostics/DiagnosticsTest.java
@@ -13,12 +13,10 @@
*******************************************************************************/
package org.eclipse.lsp4e.test.diagnostics;
-import static org.eclipse.lsp4e.test.utils.TestUtils.waitForAndAssertCondition;
-import static org.hamcrest.CoreMatchers.is;
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.junit.jupiter.api.Assertions.assertEquals;
-import static org.junit.jupiter.api.Assertions.assertNull;
-import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.eclipse.lsp4e.test.utils.TestUtils.*;
+import static org.hamcrest.CoreMatchers.*;
+import static org.hamcrest.MatcherAssert.*;
+import static org.junit.jupiter.api.Assertions.*;
import java.io.File;
import java.io.FileOutputStream;
@@ -106,7 +104,7 @@ public void testDiagnostics() throws CoreException {
assertEquals(markerCharStart, MarkerUtilities.getCharStart(marker.get()));
assertEquals(markerCharEnd, MarkerUtilities.getCharEnd(marker.get()));
assertEquals(markerLineIndex + 1, MarkerUtilities.getLineNumber(marker.get()));
- assertEquals(diagnostic.getMessage() + " [" + diagnostic.getCode().get() + "]",
+ assertEquals(diagnostic.getMessage().getLeft() + " [" + diagnostic.getCode().get() + "]",
MarkerUtilities.getMessage(marker.get()));
}
@@ -232,7 +230,7 @@ public void testDiagnosticsRangeAfterDocument() throws CoreException {
Diagnostic diagnostic = diagnostics.get(i);
IMarker marker = markers[i];
- assertEquals(diagnostic.getMessage() + " [" + diagnostic.getCode().get() + "]",
+ assertEquals(diagnostic.getMessage().getLeft() + " [" + diagnostic.getCode().get() + "]",
MarkerUtilities.getMessage(marker));
assertEquals(content.length(), MarkerUtilities.getCharStart(marker));
assertEquals(content.length(), MarkerUtilities.getCharEnd(marker));
diff --git a/org.eclipse.lsp4e.test/src/org/eclipse/lsp4e/test/edit/LSPEclipseUtilsTest.java b/org.eclipse.lsp4e.test/src/org/eclipse/lsp4e/test/edit/LSPEclipseUtilsTest.java
index 51c70f724..7304ff251 100644
--- a/org.eclipse.lsp4e.test/src/org/eclipse/lsp4e/test/edit/LSPEclipseUtilsTest.java
+++ b/org.eclipse.lsp4e.test/src/org/eclipse/lsp4e/test/edit/LSPEclipseUtilsTest.java
@@ -13,12 +13,8 @@
*******************************************************************************/
package org.eclipse.lsp4e.test.edit;
-import static org.junit.jupiter.api.Assertions.assertEquals;
-import static org.junit.jupiter.api.Assertions.assertFalse;
-import static org.junit.jupiter.api.Assertions.assertNotEquals;
-import static org.junit.jupiter.api.Assertions.assertNotNull;
-import static org.junit.jupiter.api.Assertions.assertNull;
-import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.junit.jupiter.api.Assertions.*;
+import static org.junit.jupiter.api.Assumptions.*;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
@@ -138,8 +134,9 @@ public void testWorkspaceEdit_CreateAndPopulateFile() throws Exception {
String uri = file.getLocation().toFile().toURI().toString();
edits.add(Either.forRight(new CreateFile(uri)));
edits.add(Either.forLeft(
- new TextDocumentEdit(new VersionedTextDocumentIdentifier(uri, null), List.of(
- new TextEdit(new Range(new Position(0, 0), new Position(0, 0)), "abcHere\nabcHere2")))));
+ new TextDocumentEdit(new VersionedTextDocumentIdentifier(uri, null),
+ List.of(Either.forLeft(
+ new TextEdit(new Range(new Position(0, 0), new Position(0, 0)), "abcHere\nabcHere2"))))));
final var workspaceEdit = new WorkspaceEdit(edits);
// they should be applied from bottom to top
LSPEclipseUtils.applyWorkspaceEdit(workspaceEdit);
@@ -358,8 +355,8 @@ public void testResourceOperations() throws Exception {
assertTrue(targetFile.exists());
LSPEclipseUtils.applyWorkspaceEdit(new WorkspaceEdit(List.of(Either.forLeft(
new TextDocumentEdit(new VersionedTextDocumentIdentifier(targetFile.getLocationURI().toString(), 1),
- List.of(
- new TextEdit(new Range(new Position(0, 0), new Position(0, 0)), "hello")))))));
+ List.of(Either.forLeft(
+ new TextEdit(new Range(new Position(0, 0), new Position(0, 0)), "hello"))))))));
assertEquals("hello", readContent(targetFile));
IFile otherFile = project.getFile("another/folder/file.lol");
LSPEclipseUtils.applyWorkspaceEdit(new WorkspaceEdit(List.of(Either.forRight(
@@ -388,7 +385,7 @@ public void editExternalFile() throws Exception {
te.setNewText("abc\ndef");
final var docEdit = new TextDocumentEdit(
new VersionedTextDocumentIdentifier(file.toURI().toString(), null),
- List.of(te));
+ List.of(Either.forLeft(te)));
final var we = new WorkspaceEdit(List.of(Either.forLeft(docEdit)));
LSPEclipseUtils.applyWorkspaceEdit(we);
assertTrue(file.isFile());
@@ -428,7 +425,7 @@ public void testTextEditDoesntAutomaticallySaveOpenResourceFiles() throws Except
te.setNewText("abc\ndef");
final var docEdit = new TextDocumentEdit(
new VersionedTextDocumentIdentifier(LSPEclipseUtils.toUri(targetFile).toString(), null),
- List.of(te));
+ List.of(Either.forLeft(te)));
final var we = new WorkspaceEdit(List.of(Either.forLeft(docEdit)));
LSPEclipseUtils.applyWorkspaceEdit(we);
assertEquals("abc\ndef", ((StyledText) ((AbstractTextEditor) editor).getAdapter(Control.class)).getText());
@@ -444,7 +441,7 @@ public void testTextEditDoesntAutomaticallySaveOpenExternalFiles() throws Except
te.setNewText("abc\ndef");
final var docEdit = new TextDocumentEdit(
new VersionedTextDocumentIdentifier(file.toURI().toString(), null),
- List.of(te));
+ List.of(Either.forLeft(te)));
final var we = new WorkspaceEdit(List.of(Either.forLeft(docEdit)));
LSPEclipseUtils.applyWorkspaceEdit(we);
assertEquals("abc\ndef", ((StyledText) ((AbstractTextEditor) editor).getAdapter(Control.class)).getText());
diff --git a/org.eclipse.lsp4e.test/src/org/eclipse/lsp4e/test/symbols/SymbolsUtilTest.java b/org.eclipse.lsp4e.test/src/org/eclipse/lsp4e/test/symbols/SymbolsUtilTest.java
new file mode 100644
index 000000000..e954c4f38
--- /dev/null
+++ b/org.eclipse.lsp4e.test/src/org/eclipse/lsp4e/test/symbols/SymbolsUtilTest.java
@@ -0,0 +1,88 @@
+/*******************************************************************************
+ * Copyright (c) 2024 Advantest GmbH and others.
+ * This program and the accompanying materials are made
+ * available under the terms of the Eclipse Public License 2.0
+ * which is available at https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * Dietrich Travkin (Solunar GmbH) - initial implementation
+ *******************************************************************************/
+package org.eclipse.lsp4e.test.symbols;
+
+import static org.junit.jupiter.api.Assertions.*;
+
+import java.util.Arrays;
+import java.util.List;
+
+import org.eclipse.lsp4e.operations.symbols.SymbolsUtil;
+import org.eclipse.lsp4j.DocumentSymbol;
+import org.eclipse.lsp4j.SymbolInformation;
+import org.eclipse.lsp4j.SymbolTag;
+import org.eclipse.lsp4j.WorkspaceSymbol;
+import org.junit.jupiter.api.Test;
+
+public class SymbolsUtilTest {
+
+ private static final List symbolTagsWithDeprecated = Arrays.asList(
+ SymbolTag.Package, SymbolTag.Deprecated, SymbolTag.ReadOnly);
+ private static final List symbolTagsWithoutDeprecated = Arrays.asList(
+ SymbolTag.Public, SymbolTag.Declaration, SymbolTag.Static);
+
+ @Test
+ public void testDeprecatedCheckForSymbolInformation() {
+ var symbolInformation = new SymbolInformation();
+
+ assertFalse(SymbolsUtil.isDeprecated(symbolInformation));
+
+ symbolInformation.setDeprecated(true);
+
+ assertTrue(SymbolsUtil.isDeprecated(symbolInformation));
+
+ symbolInformation = new SymbolInformation();
+ symbolInformation.setTags(symbolTagsWithDeprecated);
+
+ assertTrue(SymbolsUtil.isDeprecated(symbolInformation));
+
+ symbolInformation.setTags(symbolTagsWithoutDeprecated);
+
+ assertFalse(SymbolsUtil.isDeprecated(symbolInformation));
+ }
+
+ @Test
+ public void testDeprecatedCheckForWorkspaceSymbol() {
+ var workspaceSymbol = new WorkspaceSymbol();
+
+ assertFalse(SymbolsUtil.isDeprecated(workspaceSymbol));
+
+ workspaceSymbol.setTags(symbolTagsWithDeprecated);
+
+ assertTrue(SymbolsUtil.isDeprecated(workspaceSymbol));
+
+ workspaceSymbol.setTags(symbolTagsWithoutDeprecated);
+
+ assertFalse(SymbolsUtil.isDeprecated(workspaceSymbol));
+ }
+
+ @Test
+ public void testDeprecatedCheckForDocumentSymbol() {
+ var documentSymbol = new DocumentSymbol();
+
+ assertFalse(SymbolsUtil.isDeprecated(documentSymbol));
+
+ documentSymbol.setDeprecated(true);
+
+ assertTrue(SymbolsUtil.isDeprecated(documentSymbol));
+
+ documentSymbol = new DocumentSymbol();
+ documentSymbol.setTags(symbolTagsWithDeprecated);
+
+ assertTrue(SymbolsUtil.isDeprecated(documentSymbol));
+
+ documentSymbol.setTags(symbolTagsWithoutDeprecated);
+
+ assertFalse(SymbolsUtil.isDeprecated(documentSymbol));
+ }
+
+}
diff --git a/org.eclipse.lsp4e.test/src/org/eclipse/lsp4e/test/utils/LSPImagesTest.java b/org.eclipse.lsp4e.test/src/org/eclipse/lsp4e/test/utils/LSPImagesTest.java
new file mode 100644
index 000000000..23d806786
--- /dev/null
+++ b/org.eclipse.lsp4e.test/src/org/eclipse/lsp4e/test/utils/LSPImagesTest.java
@@ -0,0 +1,58 @@
+/*******************************************************************************
+ * Copyright (c) 2024 Advantest GmbH and others.
+ * This program and the accompanying materials are made
+ * available under the terms of the Eclipse Public License 2.0
+ * which is available at https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * Dietrich Travkin (Solunar GmbH) - initial implementation
+ *******************************************************************************/
+package org.eclipse.lsp4e.test.utils;
+
+import static org.junit.jupiter.api.Assertions.*;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.lsp4e.ui.LSPImages;
+import org.eclipse.lsp4j.CompletionItem;
+import org.eclipse.lsp4j.CompletionItemKind;
+import org.eclipse.lsp4j.SymbolKind;
+import org.eclipse.lsp4j.SymbolTag;
+import org.eclipse.swt.graphics.Image;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.EnumSource;
+import org.junit.jupiter.params.provider.EnumSource.Mode;
+
+public class LSPImagesTest {
+
+ @ParameterizedTest
+ @EnumSource(SymbolKind.class)
+ public void testAllImagesForSymbolKindAvailable(SymbolKind kind) {
+ Image img = LSPImages.imageFromSymbolKind(kind);
+
+ assertNotNull(img);
+ }
+
+ @ParameterizedTest
+ @EnumSource(SymbolTag.class)
+ public void testAllOverlayImagesForSymbolTagAvailable(SymbolTag tag) {
+ ImageDescriptor descriptor = LSPImages.imageDescriptorOverlayFromSymbolTag(tag);
+ Image img = LSPImages.imageOverlayFromSymbolTag(tag);
+
+ assertNotNull(descriptor);
+ assertNotNull(img);
+ }
+
+ @ParameterizedTest
+ @EnumSource(value=CompletionItemKind.class, mode=Mode.EXCLUDE, names= { "Color", "Event", "Operator" })
+ public void testAllImagesForCompletionItemKindAvailable(CompletionItemKind kind) {
+ CompletionItem item = new CompletionItem();
+ item.setKind(kind);
+
+ Image img = LSPImages.imageFromCompletionItem(item);
+
+ assertNotNull(img);
+ }
+
+}
diff --git a/org.eclipse.lsp4e/META-INF/MANIFEST.MF b/org.eclipse.lsp4e/META-INF/MANIFEST.MF
index 40bfd4fef..8974d720c 100644
--- a/org.eclipse.lsp4e/META-INF/MANIFEST.MF
+++ b/org.eclipse.lsp4e/META-INF/MANIFEST.MF
@@ -28,8 +28,8 @@ Require-Bundle: org.eclipse.core.runtime;bundle-version="3.12.0",
org.eclipse.tm4e.ui;resolution:=optional,
org.eclipse.ui.editors,
org.eclipse.ui.navigator;bundle-version="3.6.100",
- org.eclipse.lsp4j;bundle-version="[0.24.0,0.25.0)",
- org.eclipse.lsp4j.jsonrpc;bundle-version="[0.24.0,0.25.0)",
+ org.eclipse.lsp4j;bundle-version="[1.0.0,2.0.0)",
+ org.eclipse.lsp4j.jsonrpc;bundle-version="[1.0.0,2.0.0)",
org.eclipse.ui.console,
org.eclipse.ltk.core.refactoring,
org.eclipse.core.expressions;bundle-version="3.5.0",
diff --git a/org.eclipse.lsp4e/icons/full/obj16/constructor.png b/org.eclipse.lsp4e/icons/full/obj16/constructor.png
index ab97bb71e..71e558555 100644
Binary files a/org.eclipse.lsp4e/icons/full/obj16/constructor.png and b/org.eclipse.lsp4e/icons/full/obj16/constructor.png differ
diff --git a/org.eclipse.lsp4e/icons/full/obj16/constructor.svg b/org.eclipse.lsp4e/icons/full/obj16/constructor.svg
index c1fdb7378..4a229c816 100644
--- a/org.eclipse.lsp4e/icons/full/obj16/constructor.svg
+++ b/org.eclipse.lsp4e/icons/full/obj16/constructor.svg
@@ -2,23 +2,23 @@
diff --git a/org.eclipse.lsp4e/icons/full/obj16/constructor@2x.png b/org.eclipse.lsp4e/icons/full/obj16/constructor@2x.png
index 92aab92e7..bcae997b3 100644
Binary files a/org.eclipse.lsp4e/icons/full/obj16/constructor@2x.png and b/org.eclipse.lsp4e/icons/full/obj16/constructor@2x.png differ
diff --git a/org.eclipse.lsp4e/icons/full/ovr16/abstract_co.svg b/org.eclipse.lsp4e/icons/full/ovr16/abstract_co.svg
new file mode 100644
index 000000000..416c9365f
--- /dev/null
+++ b/org.eclipse.lsp4e/icons/full/ovr16/abstract_co.svg
@@ -0,0 +1,99 @@
+
+
+
+
diff --git a/org.eclipse.lsp4e/icons/full/ovr16/constr_ovr.svg b/org.eclipse.lsp4e/icons/full/ovr16/constr_ovr.svg
new file mode 100644
index 000000000..8c4fab343
--- /dev/null
+++ b/org.eclipse.lsp4e/icons/full/ovr16/constr_ovr.svg
@@ -0,0 +1,185 @@
+
+
+
+
diff --git a/org.eclipse.lsp4e/icons/full/ovr16/declaration_co.svg b/org.eclipse.lsp4e/icons/full/ovr16/declaration_co.svg
new file mode 100644
index 000000000..95c493013
--- /dev/null
+++ b/org.eclipse.lsp4e/icons/full/ovr16/declaration_co.svg
@@ -0,0 +1,1052 @@
+
+
+
+
diff --git a/org.eclipse.lsp4e/icons/full/ovr16/definition_co.svg b/org.eclipse.lsp4e/icons/full/ovr16/definition_co.svg
new file mode 100644
index 000000000..b106c342e
--- /dev/null
+++ b/org.eclipse.lsp4e/icons/full/ovr16/definition_co.svg
@@ -0,0 +1,1052 @@
+
+
+
+
diff --git a/org.eclipse.lsp4e/icons/full/ovr16/deprecated.svg b/org.eclipse.lsp4e/icons/full/ovr16/deprecated.svg
new file mode 100644
index 000000000..76431fe24
--- /dev/null
+++ b/org.eclipse.lsp4e/icons/full/ovr16/deprecated.svg
@@ -0,0 +1,123 @@
+
+
+
+
diff --git a/org.eclipse.lsp4e/icons/full/ovr16/file_visable_co.svg b/org.eclipse.lsp4e/icons/full/ovr16/file_visable_co.svg
new file mode 100644
index 000000000..1f56b59cc
--- /dev/null
+++ b/org.eclipse.lsp4e/icons/full/ovr16/file_visable_co.svg
@@ -0,0 +1,168 @@
+
+
+
+
diff --git a/org.eclipse.lsp4e/icons/full/ovr16/final_co.svg b/org.eclipse.lsp4e/icons/full/ovr16/final_co.svg
new file mode 100644
index 000000000..61c5103a6
--- /dev/null
+++ b/org.eclipse.lsp4e/icons/full/ovr16/final_co.svg
@@ -0,0 +1,159 @@
+
+
+
+
diff --git a/org.eclipse.lsp4e/icons/full/ovr16/implement_co.svg b/org.eclipse.lsp4e/icons/full/ovr16/implement_co.svg
new file mode 100644
index 000000000..d1325bddf
--- /dev/null
+++ b/org.eclipse.lsp4e/icons/full/ovr16/implement_co.svg
@@ -0,0 +1,828 @@
+
+
+
+
diff --git a/org.eclipse.lsp4e/icons/full/ovr16/internal_co.svg b/org.eclipse.lsp4e/icons/full/ovr16/internal_co.svg
new file mode 100644
index 000000000..c6812a413
--- /dev/null
+++ b/org.eclipse.lsp4e/icons/full/ovr16/internal_co.svg
@@ -0,0 +1,130 @@
+
+
+
+
diff --git a/org.eclipse.lsp4e/icons/full/ovr16/non_null_co.svg b/org.eclipse.lsp4e/icons/full/ovr16/non_null_co.svg
new file mode 100644
index 000000000..fec5a6692
--- /dev/null
+++ b/org.eclipse.lsp4e/icons/full/ovr16/non_null_co.svg
@@ -0,0 +1,159 @@
+
+
+
+
diff --git a/org.eclipse.lsp4e/icons/full/ovr16/nullable_co.svg b/org.eclipse.lsp4e/icons/full/ovr16/nullable_co.svg
new file mode 100644
index 000000000..92bdf7366
--- /dev/null
+++ b/org.eclipse.lsp4e/icons/full/ovr16/nullable_co.svg
@@ -0,0 +1,145 @@
+
+
+
+
diff --git a/org.eclipse.lsp4e/icons/full/ovr16/override_co.svg b/org.eclipse.lsp4e/icons/full/ovr16/override_co.svg
new file mode 100644
index 000000000..ca6269a86
--- /dev/null
+++ b/org.eclipse.lsp4e/icons/full/ovr16/override_co.svg
@@ -0,0 +1,828 @@
+
+
+
+
diff --git a/org.eclipse.lsp4e/icons/full/ovr16/package_co.svg b/org.eclipse.lsp4e/icons/full/ovr16/package_co.svg
new file mode 100644
index 000000000..dee689a3b
--- /dev/null
+++ b/org.eclipse.lsp4e/icons/full/ovr16/package_co.svg
@@ -0,0 +1,129 @@
+
+
+
+
diff --git a/org.eclipse.lsp4e/icons/full/ovr16/private_co.svg b/org.eclipse.lsp4e/icons/full/ovr16/private_co.svg
new file mode 100644
index 000000000..12ff1c672
--- /dev/null
+++ b/org.eclipse.lsp4e/icons/full/ovr16/private_co.svg
@@ -0,0 +1,4448 @@
+
+
+
+
diff --git a/org.eclipse.lsp4e/icons/full/ovr16/protected_co.svg b/org.eclipse.lsp4e/icons/full/ovr16/protected_co.svg
new file mode 100644
index 000000000..61e694bf6
--- /dev/null
+++ b/org.eclipse.lsp4e/icons/full/ovr16/protected_co.svg
@@ -0,0 +1,168 @@
+
+
+
+
diff --git a/org.eclipse.lsp4e/icons/full/ovr16/public_co.svg b/org.eclipse.lsp4e/icons/full/ovr16/public_co.svg
new file mode 100644
index 000000000..c72adc590
--- /dev/null
+++ b/org.eclipse.lsp4e/icons/full/ovr16/public_co.svg
@@ -0,0 +1,131 @@
+
+
+
+
diff --git a/org.eclipse.lsp4e/icons/full/ovr16/read_only_co.svg b/org.eclipse.lsp4e/icons/full/ovr16/read_only_co.svg
new file mode 100644
index 000000000..2aaecc516
--- /dev/null
+++ b/org.eclipse.lsp4e/icons/full/ovr16/read_only_co.svg
@@ -0,0 +1,263 @@
+
+
+
+
diff --git a/org.eclipse.lsp4e/icons/full/ovr16/sealed_co.svg b/org.eclipse.lsp4e/icons/full/ovr16/sealed_co.svg
new file mode 100644
index 000000000..b235e7d44
--- /dev/null
+++ b/org.eclipse.lsp4e/icons/full/ovr16/sealed_co.svg
@@ -0,0 +1,78 @@
+
+
+
+
diff --git a/org.eclipse.lsp4e/icons/full/ovr16/static_co.svg b/org.eclipse.lsp4e/icons/full/ovr16/static_co.svg
new file mode 100644
index 000000000..a94d9c822
--- /dev/null
+++ b/org.eclipse.lsp4e/icons/full/ovr16/static_co.svg
@@ -0,0 +1,78 @@
+
+
+
+
diff --git a/org.eclipse.lsp4e/icons/full/ovr16/synch_co.svg b/org.eclipse.lsp4e/icons/full/ovr16/synch_co.svg
new file mode 100644
index 000000000..abea286be
--- /dev/null
+++ b/org.eclipse.lsp4e/icons/full/ovr16/synch_co.svg
@@ -0,0 +1,149 @@
+
+
+
+
diff --git a/org.eclipse.lsp4e/icons/full/ovr16/transient_co.svg b/org.eclipse.lsp4e/icons/full/ovr16/transient_co.svg
new file mode 100644
index 000000000..5f98881e1
--- /dev/null
+++ b/org.eclipse.lsp4e/icons/full/ovr16/transient_co.svg
@@ -0,0 +1,111 @@
+
+
+
+
diff --git a/org.eclipse.lsp4e/icons/full/ovr16/virtual_co.svg b/org.eclipse.lsp4e/icons/full/ovr16/virtual_co.svg
new file mode 100644
index 000000000..eb3e4d528
--- /dev/null
+++ b/org.eclipse.lsp4e/icons/full/ovr16/virtual_co.svg
@@ -0,0 +1,86 @@
+
+
+
+
diff --git a/org.eclipse.lsp4e/icons/full/ovr16/volatile_co.svg b/org.eclipse.lsp4e/icons/full/ovr16/volatile_co.svg
new file mode 100644
index 000000000..979eda22c
--- /dev/null
+++ b/org.eclipse.lsp4e/icons/full/ovr16/volatile_co.svg
@@ -0,0 +1,76 @@
+
+
+
+
diff --git a/org.eclipse.lsp4e/src/org/eclipse/lsp4e/IMarkerAttributeComputer.java b/org.eclipse.lsp4e/src/org/eclipse/lsp4e/IMarkerAttributeComputer.java
index 90c4ea3dc..805fc07bf 100644
--- a/org.eclipse.lsp4e/src/org/eclipse/lsp4e/IMarkerAttributeComputer.java
+++ b/org.eclipse.lsp4e/src/org/eclipse/lsp4e/IMarkerAttributeComputer.java
@@ -16,6 +16,7 @@
import org.eclipse.core.resources.IResource;
import org.eclipse.jdt.annotation.Nullable;
import org.eclipse.jface.text.IDocument;
+import org.eclipse.lsp4e.internal.NullSafetyHelper;
import org.eclipse.lsp4j.Diagnostic;
import org.eclipse.lsp4j.jsonrpc.messages.Either;
@@ -48,8 +49,9 @@ void addMarkerAttributesForDiagnostic(Diagnostic diagnostic, @Nullable IDocument
*/
default String computeMarkerMessage(Diagnostic diagnostic) {
final Either code = diagnostic.getCode();
+ String messageText = NullSafetyHelper.defaultIfNull(diagnostic.getMessage().getLeft(), ""); //$NON-NLS-1$
return code == null //
- ? diagnostic.getMessage()
- : diagnostic.getMessage() + " [" + code.get() + "]"; //$NON-NLS-1$//$NON-NLS-2$
+ ? messageText
+ : messageText + " [" + code.get() + "]"; //$NON-NLS-1$//$NON-NLS-2$
}
}
diff --git a/org.eclipse.lsp4e/src/org/eclipse/lsp4e/LSPEclipseUtils.java b/org.eclipse.lsp4e/src/org/eclipse/lsp4e/LSPEclipseUtils.java
index 7270449ba..6f41a4c29 100644
--- a/org.eclipse.lsp4e/src/org/eclipse/lsp4e/LSPEclipseUtils.java
+++ b/org.eclipse.lsp4e/src/org/eclipse/lsp4e/LSPEclipseUtils.java
@@ -21,7 +21,7 @@
*******************************************************************************/
package org.eclipse.lsp4e;
-import static org.eclipse.lsp4e.internal.NullSafetyHelper.castNonNull;
+import static org.eclipse.lsp4e.internal.NullSafetyHelper.*;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
@@ -121,6 +121,7 @@
import org.eclipse.lsp4j.RenameFile;
import org.eclipse.lsp4j.ResourceOperation;
import org.eclipse.lsp4j.SignatureHelpParams;
+import org.eclipse.lsp4j.SnippetTextEdit;
import org.eclipse.lsp4j.TextDocumentEdit;
import org.eclipse.lsp4j.TextDocumentIdentifier;
import org.eclipse.lsp4j.TextDocumentPositionParams;
@@ -1078,7 +1079,8 @@ private static boolean applyWorkspaceEditIfSingleOpenFile(WorkspaceEdit wsEdit)
.map(TextDocumentIdentifier::getUri)
.map(LSPEclipseUtils::toUri)
.forEach(documentUris::add);
- firstDocumentEdits.addAll(wsEdit.getDocumentChanges().get(0).getLeft().getEdits());
+ firstDocumentEdits.addAll(toTextEditList(
+ wsEdit.getDocumentChanges().get(0).getLeft().getEdits()));
}
}
if (documentUris.size() != 1 || firstDocumentEdits.isEmpty()) {
@@ -1140,7 +1142,7 @@ private static CompositeChange toCompositeChange(WorkspaceEdit wsEdit, String na
TextDocumentEdit edit = action.getLeft();
VersionedTextDocumentIdentifier id = edit.getTextDocument();
URI uri = URI.create(id.getUri());
- List textEdits = edit.getEdits();
+ List textEdits = toTextEditList(edit.getEdits());
change.add(toChanges(uri, textEdits));
collectChangedURI(uri, textEdits, collector);
} else if (action.isRight()) {
@@ -1238,6 +1240,13 @@ private static CompositeChange toCompositeChange(WorkspaceEdit wsEdit, String na
return change;
}
+ private static final List toTextEditList(List> textEdits) {
+ return textEdits.stream()
+ .filter(e -> e.isLeft())
+ .map(e -> e.getLeft())
+ .toList();
+ }
+
private static final Range DEFAULT_RANGE = new Range(new Position(0, 0), new Position(0, 0));
/**
diff --git a/org.eclipse.lsp4e/src/org/eclipse/lsp4e/LanguageServerPlugin.java b/org.eclipse.lsp4e/src/org/eclipse/lsp4e/LanguageServerPlugin.java
index 0e95f700c..fe59b9bcb 100644
--- a/org.eclipse.lsp4e/src/org/eclipse/lsp4e/LanguageServerPlugin.java
+++ b/org.eclipse.lsp4e/src/org/eclipse/lsp4e/LanguageServerPlugin.java
@@ -64,8 +64,13 @@ public void start(BundleContext context) throws Exception {
@Override
public void stop(BundleContext context) throws Exception {
plugin = null;
- LanguageServiceAccessor.shutdownAllDispatchers();
- super.stop(context);
+ try {
+ LanguageServiceAccessor.shutdownAllDispatchers();
+ LSPImages.dispose();
+ }
+ finally {
+ super.stop(context);
+ }
}
/**
diff --git a/org.eclipse.lsp4e/src/org/eclipse/lsp4e/callhierarchy/CallHierarchyLabelProvider.java b/org.eclipse.lsp4e/src/org/eclipse/lsp4e/callhierarchy/CallHierarchyLabelProvider.java
index cc874037c..ba671714c 100644
--- a/org.eclipse.lsp4e/src/org/eclipse/lsp4e/callhierarchy/CallHierarchyLabelProvider.java
+++ b/org.eclipse.lsp4e/src/org/eclipse/lsp4e/callhierarchy/CallHierarchyLabelProvider.java
@@ -29,7 +29,7 @@ public class CallHierarchyLabelProvider extends LabelProvider implements IStyled
public @Nullable Image getImage(final @Nullable Object element) {
if (element instanceof CallHierarchyViewTreeNode treeNode) {
CallHierarchyItem callContainer = treeNode.getCallContainer();
- Image res = LSPImages.imageFromSymbolKind(callContainer.getKind());
+ Image res = LSPImages.getImageFor(callContainer.getKind(), callContainer.getTags());
if (res != null) {
return res;
}
diff --git a/org.eclipse.lsp4e/src/org/eclipse/lsp4e/internal/SupportedFeatures.java b/org.eclipse.lsp4e/src/org/eclipse/lsp4e/internal/SupportedFeatures.java
index f674b4eed..f8c3615c8 100644
--- a/org.eclipse.lsp4e/src/org/eclipse/lsp4e/internal/SupportedFeatures.java
+++ b/org.eclipse.lsp4e/src/org/eclipse/lsp4e/internal/SupportedFeatures.java
@@ -57,6 +57,8 @@
import org.eclipse.lsp4j.SymbolCapabilities;
import org.eclipse.lsp4j.SymbolKind;
import org.eclipse.lsp4j.SymbolKindCapabilities;
+import org.eclipse.lsp4j.SymbolTag;
+import org.eclipse.lsp4j.SymbolTagSupportCapabilities;
import org.eclipse.lsp4j.SynchronizationCapabilities;
import org.eclipse.lsp4j.TextDocumentClientCapabilities;
import org.eclipse.lsp4j.TypeDefinitionCapabilities;
@@ -120,6 +122,7 @@ public static TextDocumentClientCapabilities getTextDocumentClientCapabilities()
final var documentSymbol = new DocumentSymbolCapabilities();
documentSymbol.setHierarchicalDocumentSymbolSupport(true);
documentSymbol.setSymbolKind(new SymbolKindCapabilities(List.of(SymbolKind.values())));
+ documentSymbol.setTagSupport(new SymbolTagSupportCapabilities(List.of(SymbolTag.values())));
textDocumentClientCapabilities.setDocumentSymbol(documentSymbol);
final var foldingRangeCapabilities = new FoldingRangeCapabilities();
foldingRangeCapabilities.setLineFoldingOnly(true);
@@ -153,7 +156,9 @@ public static WorkspaceClientCapabilities getWorkspaceClientCapabilities() {
workspaceClientCapabilities.setApplyEdit(true);
workspaceClientCapabilities.setConfiguration(true);
workspaceClientCapabilities.setExecuteCommand(new ExecuteCommandCapabilities(true));
- workspaceClientCapabilities.setSymbol(new SymbolCapabilities(true));
+ SymbolCapabilities symbolCapabilities = new SymbolCapabilities(true);
+ symbolCapabilities.setTagSupport(new SymbolTagSupportCapabilities(List.of(SymbolTag.values())));
+ workspaceClientCapabilities.setSymbol(symbolCapabilities);
workspaceClientCapabilities.setWorkspaceFolders(true);
final var editCapabilities = new WorkspaceEditCapabilities();
diff --git a/org.eclipse.lsp4e/src/org/eclipse/lsp4e/operations/symbols/SymbolsUtil.java b/org.eclipse.lsp4e/src/org/eclipse/lsp4e/operations/symbols/SymbolsUtil.java
new file mode 100644
index 000000000..884645904
--- /dev/null
+++ b/org.eclipse.lsp4e/src/org/eclipse/lsp4e/operations/symbols/SymbolsUtil.java
@@ -0,0 +1,188 @@
+/*******************************************************************************
+ * Copyright (c) 2024 Advantest GmbH and others.
+ * This program and the accompanying materials are made
+ * available under the terms of the Eclipse Public License 2.0
+ * which is available at https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * Dietrich Travkin (Solunar GmbH) - initial implementation
+ *******************************************************************************/
+package org.eclipse.lsp4e.operations.symbols;
+
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.lsp4e.outline.SymbolsModel.DocumentSymbolWithURI;
+import org.eclipse.lsp4j.DocumentSymbol;
+import org.eclipse.lsp4j.SymbolInformation;
+import org.eclipse.lsp4j.SymbolKind;
+import org.eclipse.lsp4j.SymbolTag;
+import org.eclipse.lsp4j.WorkspaceSymbol;
+
+public class SymbolsUtil {
+
+ public static SymbolKind getKind(SymbolInformation symbolInformation) {
+ return symbolInformation.getKind();
+ }
+
+ public static SymbolKind getKind(WorkspaceSymbol workspaceSymbol) {
+ return workspaceSymbol.getKind();
+ }
+
+ public static SymbolKind getKind(DocumentSymbol documentSymbol) {
+ return documentSymbol.getKind();
+ }
+
+ public static SymbolKind getKind(DocumentSymbolWithURI documentSymbolWithUri) {
+ return getKind(documentSymbolWithUri.symbol);
+ }
+
+ public static List getSymbolTags(SymbolInformation symbolInformation) {
+ if (symbolInformation.getTags() != null) {
+ return symbolInformation.getTags();
+ }
+
+ return Collections.emptyList();
+ }
+
+ public static List getSymbolTags(WorkspaceSymbol workspaceSymbol) {
+ if (workspaceSymbol.getTags() != null) {
+ return workspaceSymbol.getTags();
+ }
+
+ return Collections.emptyList();
+ }
+
+ public static List getSymbolTags(DocumentSymbol documentSymbol) {
+ if (documentSymbol.getTags() != null) {
+ return documentSymbol.getTags();
+ }
+
+ return Collections.emptyList();
+ }
+
+ public static List getSymbolTags(DocumentSymbolWithURI documentSymbolWithUri) {
+ return getSymbolTags(documentSymbolWithUri.symbol);
+ }
+
+ public static boolean hasSymbolTag(List tagList, SymbolTag tag) {
+ return tagList.contains(tag);
+ }
+
+ public static boolean hasSymbolTag(SymbolInformation symbolInformation, SymbolTag tag) {
+ return getSymbolTags(symbolInformation).contains(tag);
+ }
+
+ public static boolean hasSymbolTag(WorkspaceSymbol workspaceSymbol, SymbolTag tag) {
+ return getSymbolTags(workspaceSymbol).contains(tag);
+ }
+
+ public static boolean hasSymbolTag(DocumentSymbol documentSymbol, SymbolTag tag) {
+ return getSymbolTags(documentSymbol).contains(tag);
+ }
+
+ public static boolean hasSymbolTag(DocumentSymbolWithURI documentSymbolWithUri, SymbolTag tag) {
+ return getSymbolTags(documentSymbolWithUri).contains(tag);
+ }
+
+ public static boolean isDeprecated(SymbolInformation symbolInformation) {
+ boolean deprecated = isDeprecated(getSymbolTags(symbolInformation));
+ return deprecated || (symbolInformation.getDeprecated() == null ? false: symbolInformation.getDeprecated());
+ }
+
+ public static boolean isDeprecated(WorkspaceSymbol workspaceSymbol) {
+ return isDeprecated(getSymbolTags(workspaceSymbol));
+ }
+
+ public static boolean isDeprecated(DocumentSymbol documentSymbol) {
+ boolean deprecated = isDeprecated(getSymbolTags(documentSymbol));
+ return deprecated || (documentSymbol.getDeprecated() == null ? false: documentSymbol.getDeprecated());
+ }
+
+ public static boolean isDeprecated(DocumentSymbolWithURI documentSymbolWithUri) {
+ return isDeprecated(documentSymbolWithUri.symbol);
+ }
+
+ public static boolean isDeprecated(List tags) {
+ return SymbolsUtil.hasSymbolTag(tags, SymbolTag.Deprecated);
+ }
+
+ public static boolean isPrivate(List tags) {
+ return SymbolsUtil.hasSymbolTag(tags, SymbolTag.Private);
+ }
+
+ public static boolean isPackage(List tags) {
+ return SymbolsUtil.hasSymbolTag(tags, SymbolTag.Package);
+ }
+
+ public static boolean isProtected(List tags) {
+ return SymbolsUtil.hasSymbolTag(tags, SymbolTag.Protected);
+ }
+
+ public static boolean isPublic(List tags) {
+ return SymbolsUtil.hasSymbolTag(tags, SymbolTag.Public);
+ }
+
+ public static boolean isInternal(List tags) {
+ return SymbolsUtil.hasSymbolTag(tags, SymbolTag.Internal);
+ }
+
+ public static boolean isFileVisible(List tags) {
+ return SymbolsUtil.hasSymbolTag(tags, SymbolTag.File);
+ }
+
+ public static boolean isStatic(List tags) {
+ return SymbolsUtil.hasSymbolTag(tags, SymbolTag.Static);
+ }
+
+ public static boolean isAbstract(List tags) {
+ return SymbolsUtil.hasSymbolTag(tags, SymbolTag.Abstract);
+ }
+
+ public static boolean isFinal(List tags) {
+ return SymbolsUtil.hasSymbolTag(tags, SymbolTag.Final);
+ }
+
+ public static boolean isSealed(List tags) {
+ return SymbolsUtil.hasSymbolTag(tags, SymbolTag.Sealed);
+ }
+
+ public static boolean isTransient(List tags) {
+ return SymbolsUtil.hasSymbolTag(tags, SymbolTag.Transient);
+ }
+
+ public static boolean isVolatile(List tags) {
+ return SymbolsUtil.hasSymbolTag(tags, SymbolTag.Volatile);
+ }
+
+ public static boolean isSynchronized(List tags) {
+ return SymbolsUtil.hasSymbolTag(tags, SymbolTag.Synchronized);
+ }
+
+ public static boolean isVirtual(List tags) {
+ return SymbolsUtil.hasSymbolTag(tags, SymbolTag.Virtual);
+ }
+
+ public static boolean isNullable(List tags) {
+ return SymbolsUtil.hasSymbolTag(tags, SymbolTag.Nullable);
+ }
+
+ public static boolean isNonNull(List tags) {
+ return SymbolsUtil.hasSymbolTag(tags, SymbolTag.NonNull);
+ }
+
+ public static boolean isDeclaration(List tags) {
+ return SymbolsUtil.hasSymbolTag(tags, SymbolTag.Declaration);
+ }
+
+ public static boolean isDefinition(List tags) {
+ return SymbolsUtil.hasSymbolTag(tags, SymbolTag.Definition);
+ }
+
+ public static boolean isReadOnly(List tags) {
+ return SymbolsUtil.hasSymbolTag(tags, SymbolTag.ReadOnly);
+ }
+
+}
diff --git a/org.eclipse.lsp4e/src/org/eclipse/lsp4e/operations/typeHierarchy/TypeHierarchyItemLabelProvider.java b/org.eclipse.lsp4e/src/org/eclipse/lsp4e/operations/typeHierarchy/TypeHierarchyItemLabelProvider.java
index 1cea86359..c4f4841cd 100644
--- a/org.eclipse.lsp4e/src/org/eclipse/lsp4e/operations/typeHierarchy/TypeHierarchyItemLabelProvider.java
+++ b/org.eclipse.lsp4e/src/org/eclipse/lsp4e/operations/typeHierarchy/TypeHierarchyItemLabelProvider.java
@@ -29,7 +29,7 @@ public String getText(Object element) {
@Override
public @Nullable Image getImage(@Nullable Object element) {
if (element instanceof TypeHierarchyItem item) {
- return LSPImages.imageFromSymbolKind(item.getKind());
+ return LSPImages.getImageFor(item.getKind(), item.getTags());
}
return element == null ? null : super.getImage(element);
}
diff --git a/org.eclipse.lsp4e/src/org/eclipse/lsp4e/outline/SymbolsLabelProvider.java b/org.eclipse.lsp4e/src/org/eclipse/lsp4e/outline/SymbolsLabelProvider.java
index 69720ffbc..b53341f7e 100644
--- a/org.eclipse.lsp4e/src/org/eclipse/lsp4e/outline/SymbolsLabelProvider.java
+++ b/org.eclipse.lsp4e/src/org/eclipse/lsp4e/outline/SymbolsLabelProvider.java
@@ -11,16 +11,15 @@
*******************************************************************************/
package org.eclipse.lsp4e.outline;
-import static org.eclipse.lsp4e.LSPEclipseUtils.findResourceFor;
-import static org.eclipse.lsp4e.internal.NullSafetyHelper.castNullable;
+import static org.eclipse.lsp4e.LSPEclipseUtils.*;
import java.net.URI;
import java.util.Arrays;
+import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import java.util.Objects;
import org.eclipse.core.resources.IMarker;
import org.eclipse.core.resources.IResource;
@@ -35,9 +34,7 @@
import org.eclipse.jface.resource.JFaceResources;
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.viewers.DecorationOverlayIcon;
import org.eclipse.jface.viewers.DelegatingStyledCellLabelProvider.IStyledLabelProvider;
-import org.eclipse.jface.viewers.IDecoration;
import org.eclipse.jface.viewers.ILabelProviderListener;
import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.jface.viewers.LabelProviderChangedEvent;
@@ -45,6 +42,7 @@
import org.eclipse.lsp4e.LSPEclipseUtils;
import org.eclipse.lsp4e.LanguageServerPlugin;
import org.eclipse.lsp4e.internal.StyleUtil;
+import org.eclipse.lsp4e.operations.symbols.SymbolsUtil;
import org.eclipse.lsp4e.outline.SymbolsModel.DocumentSymbolWithURI;
import org.eclipse.lsp4e.ui.LSPImages;
import org.eclipse.lsp4e.ui.Messages;
@@ -87,11 +85,7 @@ public class SymbolsLabelProvider extends LabelProvider
LanguageServerPlugin.logError(ex);
}
};
- /*
- * key: initial object image
- * value: array of images decorated with marker for severity (index + 1)
- */
- private final Map overlays = new HashMap<>();
+
private final Map