From b41ac818d72ce1668b528e4ee3582e0286a3f939 Mon Sep 17 00:00:00 2001 From: Niklas Rentz Date: Mon, 11 Mar 2024 11:03:10 +0100 Subject: [PATCH 1/2] update to Sprotty 1.1.1 --- .../category.xml | 2 +- .../pom.xml | 2 +- ...er.klighd.targetplatform-elkNightly.target | 2 +- ...d.targetplatform-piccolo-elkNightly.target | 2 +- ...ieler.klighd.targetplatform-piccolo.target | 2 +- ...cau.cs.kieler.klighd.targetplatform.target | 2 +- .../klighd/lsp/KGraphDiagramServer.xtend | 8 ++--- .../klighd/lsp/KGraphDiagramUpdater.xtend | 33 ++++++++++++------- .../lsp/KGraphLanguageServerExtension.xtend | 3 +- pom.xml | 2 +- 10 files changed, 33 insertions(+), 25 deletions(-) diff --git a/build/de.cau.cs.kieler.klighd.repository/category.xml b/build/de.cau.cs.kieler.klighd.repository/category.xml index 7d0c7f9d5..004bcf59f 100644 --- a/build/de.cau.cs.kieler.klighd.repository/category.xml +++ b/build/de.cau.cs.kieler.klighd.repository/category.xml @@ -69,5 +69,5 @@ - + diff --git a/build/de.cau.cs.kieler.klighd.repository/pom.xml b/build/de.cau.cs.kieler.klighd.repository/pom.xml index eb94937db..536997d14 100644 --- a/build/de.cau.cs.kieler.klighd.repository/pom.xml +++ b/build/de.cau.cs.kieler.klighd.repository/pom.xml @@ -64,7 +64,7 @@ https://download.eclipse.org/tools/orbit/simrel/orbit-aggregation/release/4.30.0 - https://rtsys.informatik.uni-kiel.de/~kieler/updatesite/sprotty/0.9.0/ + https://rtsys.informatik.uni-kiel.de/~kieler/updatesite/sprotty/1.1.1/ siteTemplate diff --git a/build/de.cau.cs.kieler.klighd.targetplatform/de.cau.cs.kieler.klighd.targetplatform-elkNightly.target b/build/de.cau.cs.kieler.klighd.targetplatform/de.cau.cs.kieler.klighd.targetplatform-elkNightly.target index 3d08e692f..103fdaa2a 100644 --- a/build/de.cau.cs.kieler.klighd.targetplatform/de.cau.cs.kieler.klighd.targetplatform-elkNightly.target +++ b/build/de.cau.cs.kieler.klighd.targetplatform/de.cau.cs.kieler.klighd.targetplatform-elkNightly.target @@ -45,7 +45,7 @@ - + \ No newline at end of file diff --git a/build/de.cau.cs.kieler.klighd.targetplatform/de.cau.cs.kieler.klighd.targetplatform-piccolo-elkNightly.target b/build/de.cau.cs.kieler.klighd.targetplatform/de.cau.cs.kieler.klighd.targetplatform-piccolo-elkNightly.target index 8f00f2b0c..c0a3afcb9 100644 --- a/build/de.cau.cs.kieler.klighd.targetplatform/de.cau.cs.kieler.klighd.targetplatform-piccolo-elkNightly.target +++ b/build/de.cau.cs.kieler.klighd.targetplatform/de.cau.cs.kieler.klighd.targetplatform-piccolo-elkNightly.target @@ -49,7 +49,7 @@ - + \ No newline at end of file diff --git a/build/de.cau.cs.kieler.klighd.targetplatform/de.cau.cs.kieler.klighd.targetplatform-piccolo.target b/build/de.cau.cs.kieler.klighd.targetplatform/de.cau.cs.kieler.klighd.targetplatform-piccolo.target index d1f752741..de4c726b4 100644 --- a/build/de.cau.cs.kieler.klighd.targetplatform/de.cau.cs.kieler.klighd.targetplatform-piccolo.target +++ b/build/de.cau.cs.kieler.klighd.targetplatform/de.cau.cs.kieler.klighd.targetplatform-piccolo.target @@ -49,7 +49,7 @@ - + \ No newline at end of file diff --git a/build/de.cau.cs.kieler.klighd.targetplatform/de.cau.cs.kieler.klighd.targetplatform.target b/build/de.cau.cs.kieler.klighd.targetplatform/de.cau.cs.kieler.klighd.targetplatform.target index 9ec8e1d19..2e5b3a4d8 100644 --- a/build/de.cau.cs.kieler.klighd.targetplatform/de.cau.cs.kieler.klighd.targetplatform.target +++ b/build/de.cau.cs.kieler.klighd.targetplatform/de.cau.cs.kieler.klighd.targetplatform.target @@ -45,7 +45,7 @@ - + \ No newline at end of file diff --git a/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/KGraphDiagramServer.xtend b/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/KGraphDiagramServer.xtend index d67576498..5b9a9160d 100644 --- a/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/KGraphDiagramServer.xtend +++ b/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/KGraphDiagramServer.xtend @@ -3,7 +3,7 @@ * * http://rtsys.informatik.uni-kiel.de/kieler * - * Copyright 2018-2022 by + * Copyright 2018-2024 by * + Kiel University * + Department of Computer Science * + Real-Time and Embedded Systems Group @@ -384,11 +384,9 @@ class KGraphDiagramServer extends LanguageAwareDiagramServer { * FIXME Remove this if UpdateModelAction has a cause. */ override protected handle(RequestModelAction request) { - if (model.type == 'NONE' && diagramLanguageServer !== null) { - if (!request.requestId.nullOrEmpty) - LOG.warn("Model requests are not supported by the Xtext diagram server.") + if (diagramLanguageServer !== null) { copyOptions(request) - diagramLanguageServer.diagramUpdater.updateDiagram(this) + diagramLanguageServer.diagramUpdater.updateDiagram(this, request) } else { super.handle(request) } diff --git a/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/KGraphDiagramUpdater.xtend b/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/KGraphDiagramUpdater.xtend index 9755d54f2..7c6905338 100644 --- a/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/KGraphDiagramUpdater.xtend +++ b/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/KGraphDiagramUpdater.xtend @@ -3,7 +3,7 @@ * * http://rtsys.informatik.uni-kiel.de/kieler * - * Copyright 2019, 2020, 2021 by + * Copyright 2019-2024 by * + Kiel University * + Department of Computer Science * + Real-Time and Embedded Systems Group @@ -37,10 +37,12 @@ import java.util.Map import java.util.concurrent.CompletableFuture import org.eclipse.emf.common.util.URI import org.eclipse.emf.ecore.EObject +import org.eclipse.sprotty.Action import org.eclipse.sprotty.IDiagramServer import org.eclipse.sprotty.SGraph import org.eclipse.sprotty.SModelElement import org.eclipse.sprotty.xtext.ILanguageAwareDiagramServer +import org.eclipse.sprotty.xtext.LanguageAwareDiagramServer import org.eclipse.sprotty.xtext.ls.DiagramLanguageServer import org.eclipse.sprotty.xtext.ls.DiagramUpdater import org.eclipse.xtext.util.CancelIndicator @@ -137,7 +139,19 @@ class KGraphDiagramUpdater extends DiagramUpdater { } override protected doUpdateDiagrams(String uri, List diagramServers) { - if (diagramServers.empty) { + diagramServers.forEach[updateDiagram(it as LanguageAwareDiagramServer, null)] + return CompletableFuture.completedFuture(null) + } + + override updateDiagram(LanguageAwareDiagramServer server_, Action cause) { + if (!(server_ instanceof KGraphDiagramServer)) return super.updateDiagram(server_, cause) + + val server = server_ as KGraphDiagramServer + val uri = server.sourceUri + if (uri.isNullOrEmpty) { + val exc = new RuntimeException("Missing property 'sourceUri'.") + server.rejectRemoteRequest(cause, exc) +// LOG.error("Failed to update diagram.", exc) return CompletableFuture.completedFuture(null) } return (languageServer as KGraphLanguageServerExtension).doRead(uri) [ resource, ci | @@ -166,16 +180,13 @@ class KGraphDiagramUpdater extends DiagramUpdater { new StringBuilder, [builder, error | builder.append("\n" + error)]).toString model = new MessageModel("The model contains errors:\n" + errors) } - val model_ = model; - (diagramServers as List).forEach [ KGraphDiagramServer server | - // Only update an erroneous model if there was no diagram shown before. - if (!hasErrors || server.currentRoot.type == "NONE") { - synchronized (diagramState) { - prepareModel(server, model_, uri) - updateLayout(server) - } + // Only update an erroneous model if there was no diagram shown before. + if (!hasErrors || server.currentRoot.type == "NONE") { + synchronized (diagramState) { + prepareModel(server, model, uri) + updateLayout(server) } - ] + } return null as Void ] } diff --git a/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/KGraphLanguageServerExtension.xtend b/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/KGraphLanguageServerExtension.xtend index 087b62b7b..4d707ad41 100644 --- a/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/KGraphLanguageServerExtension.xtend +++ b/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/KGraphLanguageServerExtension.xtend @@ -134,8 +134,7 @@ class KGraphLanguageServerExtension extends SyncDiagramLanguageServer override accept(ActionMessage message) { if (message.action instanceof RequestModelAction) { val action = message.action as RequestModelAction - val diagramType = action.diagramType - ?: action.options.get(DiagramOptions.OPTION_DIAGRAM_TYPE) + val diagramType = action.options.get(DiagramOptions.OPTION_DIAGRAM_TYPE) val server = diagramServerManager.getDiagramServer(diagramType, message.clientId) // If a diagram server is requested for the same client, but a different source file, then close the old server. // If the server does not have options yet, the server has not been used yet and does not need to be relaunched. diff --git a/pom.xml b/pom.xml index 8a6fd02f4..d012394f1 100644 --- a/pom.xml +++ b/pom.xml @@ -57,7 +57,7 @@ 7.0.0 3.32.0 0.21.1 - 0.9.0 + 1.1.1 0.1.0 3.124.200 2.7.3 From 0a2319b2573f8b1ed7c0702d4f8833a9e55a2f3c Mon Sep 17 00:00:00 2001 From: Niklas Rentz Date: Tue, 12 Mar 2024 17:36:45 +0100 Subject: [PATCH 2/2] removed Plugin nature from LSP, it should only be used as a plain Maven artifact. Update to lsp4j 0.22.0 (maven dependency only) --- .../category.xml | 3 --- .../pom.xml | 2 -- ...er.klighd.targetplatform-elkNightly.target | 4 --- ...d.targetplatform-piccolo-elkNightly.target | 4 --- ...ieler.klighd.targetplatform-piccolo.target | 4 --- ...cau.cs.kieler.klighd.targetplatform.target | 4 --- .../de.cau.cs.kieler.klighd.lsp/.classpath | 26 ++++++++++++++++--- plugins/de.cau.cs.kieler.klighd.lsp/.project | 11 -------- .../org.eclipse.core.resources.prefs | 1 + .../org.eclipse.xtend.core.Xtend.prefs | 2 ++ plugins/de.cau.cs.kieler.klighd.lsp/pom.xml | 1 - pom.xml | 2 +- 12 files changed, 27 insertions(+), 37 deletions(-) diff --git a/build/de.cau.cs.kieler.klighd.repository/category.xml b/build/de.cau.cs.kieler.klighd.repository/category.xml index 004bcf59f..5216ede61 100644 --- a/build/de.cau.cs.kieler.klighd.repository/category.xml +++ b/build/de.cau.cs.kieler.klighd.repository/category.xml @@ -60,8 +60,6 @@ - - @@ -69,5 +67,4 @@ - diff --git a/build/de.cau.cs.kieler.klighd.repository/pom.xml b/build/de.cau.cs.kieler.klighd.repository/pom.xml index 536997d14..cfa0d42fc 100644 --- a/build/de.cau.cs.kieler.klighd.repository/pom.xml +++ b/build/de.cau.cs.kieler.klighd.repository/pom.xml @@ -63,8 +63,6 @@ https://xtext.github.io/download/updates/releases/2.1.1/> https://download.eclipse.org/tools/orbit/simrel/orbit-aggregation/release/4.30.0 - - https://rtsys.informatik.uni-kiel.de/~kieler/updatesite/sprotty/1.1.1/ siteTemplate diff --git a/build/de.cau.cs.kieler.klighd.targetplatform/de.cau.cs.kieler.klighd.targetplatform-elkNightly.target b/build/de.cau.cs.kieler.klighd.targetplatform/de.cau.cs.kieler.klighd.targetplatform-elkNightly.target index 103fdaa2a..2a3c0eccd 100644 --- a/build/de.cau.cs.kieler.klighd.targetplatform/de.cau.cs.kieler.klighd.targetplatform-elkNightly.target +++ b/build/de.cau.cs.kieler.klighd.targetplatform/de.cau.cs.kieler.klighd.targetplatform-elkNightly.target @@ -43,9 +43,5 @@ - - - - \ No newline at end of file diff --git a/build/de.cau.cs.kieler.klighd.targetplatform/de.cau.cs.kieler.klighd.targetplatform-piccolo-elkNightly.target b/build/de.cau.cs.kieler.klighd.targetplatform/de.cau.cs.kieler.klighd.targetplatform-piccolo-elkNightly.target index c0a3afcb9..fc4b1e392 100644 --- a/build/de.cau.cs.kieler.klighd.targetplatform/de.cau.cs.kieler.klighd.targetplatform-piccolo-elkNightly.target +++ b/build/de.cau.cs.kieler.klighd.targetplatform/de.cau.cs.kieler.klighd.targetplatform-piccolo-elkNightly.target @@ -47,9 +47,5 @@ - - - - \ No newline at end of file diff --git a/build/de.cau.cs.kieler.klighd.targetplatform/de.cau.cs.kieler.klighd.targetplatform-piccolo.target b/build/de.cau.cs.kieler.klighd.targetplatform/de.cau.cs.kieler.klighd.targetplatform-piccolo.target index de4c726b4..8c9f1fff6 100644 --- a/build/de.cau.cs.kieler.klighd.targetplatform/de.cau.cs.kieler.klighd.targetplatform-piccolo.target +++ b/build/de.cau.cs.kieler.klighd.targetplatform/de.cau.cs.kieler.klighd.targetplatform-piccolo.target @@ -47,9 +47,5 @@ - - - - \ No newline at end of file diff --git a/build/de.cau.cs.kieler.klighd.targetplatform/de.cau.cs.kieler.klighd.targetplatform.target b/build/de.cau.cs.kieler.klighd.targetplatform/de.cau.cs.kieler.klighd.targetplatform.target index 2e5b3a4d8..19e50c619 100644 --- a/build/de.cau.cs.kieler.klighd.targetplatform/de.cau.cs.kieler.klighd.targetplatform.target +++ b/build/de.cau.cs.kieler.klighd.targetplatform/de.cau.cs.kieler.klighd.targetplatform.target @@ -43,9 +43,5 @@ - - - - \ No newline at end of file diff --git a/plugins/de.cau.cs.kieler.klighd.lsp/.classpath b/plugins/de.cau.cs.kieler.klighd.lsp/.classpath index 7cd7b128b..59a498ec0 100644 --- a/plugins/de.cau.cs.kieler.klighd.lsp/.classpath +++ b/plugins/de.cau.cs.kieler.klighd.lsp/.classpath @@ -5,8 +5,28 @@ - - - + + + + + + + + + + + + + + + + + + + + + + + diff --git a/plugins/de.cau.cs.kieler.klighd.lsp/.project b/plugins/de.cau.cs.kieler.klighd.lsp/.project index 27cf23a80..918374c6f 100644 --- a/plugins/de.cau.cs.kieler.klighd.lsp/.project +++ b/plugins/de.cau.cs.kieler.klighd.lsp/.project @@ -15,16 +15,6 @@ - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - org.eclipse.m2e.core.maven2Builder @@ -35,6 +25,5 @@ org.eclipse.jdt.core.javanature org.eclipse.xtext.ui.shared.xtextNature org.eclipse.m2e.core.maven2Nature - org.eclipse.pde.PluginNature diff --git a/plugins/de.cau.cs.kieler.klighd.lsp/.settings/org.eclipse.core.resources.prefs b/plugins/de.cau.cs.kieler.klighd.lsp/.settings/org.eclipse.core.resources.prefs index 7a5313928..505845e4f 100644 --- a/plugins/de.cau.cs.kieler.klighd.lsp/.settings/org.eclipse.core.resources.prefs +++ b/plugins/de.cau.cs.kieler.klighd.lsp/.settings/org.eclipse.core.resources.prefs @@ -1,3 +1,4 @@ eclipse.preferences.version=1 encoding/=UTF-8 encoding/src=UTF-8 +encoding/xtend-gen=UTF-8 diff --git a/plugins/de.cau.cs.kieler.klighd.lsp/.settings/org.eclipse.xtend.core.Xtend.prefs b/plugins/de.cau.cs.kieler.klighd.lsp/.settings/org.eclipse.xtend.core.Xtend.prefs index 56e3bbe88..2b65c6b65 100644 --- a/plugins/de.cau.cs.kieler.klighd.lsp/.settings/org.eclipse.xtend.core.Xtend.prefs +++ b/plugins/de.cau.cs.kieler.klighd.lsp/.settings/org.eclipse.xtend.core.Xtend.prefs @@ -2,5 +2,7 @@ BuilderConfiguration.is_project_specific=true eclipse.preferences.version=1 outlet.DEFAULT_OUTPUT.hideLocalSyntheticVariables=true outlet.DEFAULT_OUTPUT.installDslAsPrimarySource=false +outlet.DEFAULT_OUTPUT.sourceFolder.src-gen.directory=xtend-gen outlet.DEFAULT_OUTPUT.sourceFolder.src.directory=xtend-gen +outlet.DEFAULT_OUTPUT.sourceFolder.xtend-gen.directory=xtend-gen outlet.DEFAULT_OUTPUT.userOutputPerSourceFolder=true diff --git a/plugins/de.cau.cs.kieler.klighd.lsp/pom.xml b/plugins/de.cau.cs.kieler.klighd.lsp/pom.xml index 01029cca8..2c75eb316 100644 --- a/plugins/de.cau.cs.kieler.klighd.lsp/pom.xml +++ b/plugins/de.cau.cs.kieler.klighd.lsp/pom.xml @@ -10,7 +10,6 @@ de.cau.cs.kieler.klighd.lsp - eclipse-plugin KIELER Lightweight Diagrams as Language Server KIELER Lightweight Diagrams as Language Server diff --git a/pom.xml b/pom.xml index d012394f1..37b93201a 100644 --- a/pom.xml +++ b/pom.xml @@ -56,7 +56,7 @@ 32.1.3-jre 7.0.0 3.32.0 - 0.21.1 + 0.22.0 1.1.1 0.1.0 3.124.200