From 4c090a12ddb6a6fcf382364df41196cc32bc5787 Mon Sep 17 00:00:00 2001 From: Fred Bricon Date: Tue, 7 Nov 2023 17:19:16 +0100 Subject: [PATCH] chore: fix some deprecation warnings Signed-off-by: Fred Bricon --- .../lsp4ij/LanguageServiceAccessor.java | 4 ++-- .../intellij/lsp4ij/ServerMessageHandler.java | 23 +++++++------------ .../LanguageServerProcessTreeNode.java | 4 ++-- .../LanguageServerLifecycleManager.java | 6 ++--- .../diagnostics/LSPDiagnosticHandler.java | 11 +++++---- .../ClasspathResourceChangedManager.java | 8 +++---- .../core/project/AbstractConfigSource.java | 3 ++- .../PsiMicroProfileProjectManager.java | 5 ++-- .../quarkus/QuarkusDeploymentSupport.java | 5 ++-- .../quarkus/QuarkusProjectService.java | 6 ++--- .../facet/QuarkusFrameworkDetector.java | 4 ++-- .../gradle/AbstractGradleToolDelegate.java | 10 +++----- .../intellij/quarkus/lsp/QuarkusServer.java | 16 +++++++++---- .../qute/facet/QuteFrameworkDetector.java | 4 ++-- .../qute/lang/psi/QuteElementType.java | 2 +- .../intellij/qute/lsp/QuteServer.java | 11 ++++++--- src/main/resources/META-INF/lsp4ij.xml | 1 + 17 files changed, 62 insertions(+), 61 deletions(-) diff --git a/src/main/java/com/redhat/devtools/intellij/lsp4ij/LanguageServiceAccessor.java b/src/main/java/com/redhat/devtools/intellij/lsp4ij/LanguageServiceAccessor.java index 0af143e11..7ed418300 100644 --- a/src/main/java/com/redhat/devtools/intellij/lsp4ij/LanguageServiceAccessor.java +++ b/src/main/java/com/redhat/devtools/intellij/lsp4ij/LanguageServiceAccessor.java @@ -40,8 +40,8 @@ public class LanguageServiceAccessor { private final Project project; - public static LanguageServiceAccessor getInstance(Project project) { - return ServiceManager.getService(project, LanguageServiceAccessor.class); + public static LanguageServiceAccessor getInstance(@NotNull Project project) { + return project.getService(LanguageServiceAccessor.class); } private LanguageServiceAccessor(Project project) { diff --git a/src/main/java/com/redhat/devtools/intellij/lsp4ij/ServerMessageHandler.java b/src/main/java/com/redhat/devtools/intellij/lsp4ij/ServerMessageHandler.java index 2704187a1..2aa0fd81f 100644 --- a/src/main/java/com/redhat/devtools/intellij/lsp4ij/ServerMessageHandler.java +++ b/src/main/java/com/redhat/devtools/intellij/lsp4ij/ServerMessageHandler.java @@ -44,30 +44,23 @@ private static Icon messageTypeToIcon(MessageType type) { } private static NotificationType messageTypeToNotificationType(MessageType type) { - NotificationType result = null; - - switch (type) { - case Error: - result = NotificationType.ERROR; - break; - case Info: - case Log: - result = NotificationType.INFORMATION; - break; - case Warning: - result = NotificationType.WARNING; - } + NotificationType result = switch (type) { + case Error -> NotificationType.ERROR; + case Info, Log -> NotificationType.INFORMATION; + case Warning -> NotificationType.WARNING; + }; return result; } public static void showMessage(String title, MessageParams params) { - Notification notification = new Notification("Language Server Protocol", messageTypeToIcon(params.getType()), title, null, params.getMessage(), messageTypeToNotificationType(params.getType()), null); + Notification notification = new Notification("Language Server Protocol", title, params.getMessage(), messageTypeToNotificationType(params.getType())); + notification.setIcon(messageTypeToIcon(params.getType())); Notifications.Bus.notify(notification); } public static CompletableFuture showMessageRequest(LanguageServerWrapper wrapper, ShowMessageRequestParams params) { - String options[] = params.getActions().stream().map(MessageActionItem::getTitle).toArray(String[]::new); + String[] options = params.getActions().stream().map(MessageActionItem::getTitle).toArray(String[]::new); CompletableFuture future = new CompletableFuture<>(); ApplicationManager.getApplication().invokeLater(() -> { diff --git a/src/main/java/com/redhat/devtools/intellij/lsp4ij/console/explorer/LanguageServerProcessTreeNode.java b/src/main/java/com/redhat/devtools/intellij/lsp4ij/console/explorer/LanguageServerProcessTreeNode.java index 587f92542..fc9950460 100644 --- a/src/main/java/com/redhat/devtools/intellij/lsp4ij/console/explorer/LanguageServerProcessTreeNode.java +++ b/src/main/java/com/redhat/devtools/intellij/lsp4ij/console/explorer/LanguageServerProcessTreeNode.java @@ -14,7 +14,7 @@ package com.redhat.devtools.intellij.lsp4ij.console.explorer; import com.intellij.icons.AllIcons; -import com.intellij.openapi.util.text.StringUtil; +import com.intellij.openapi.util.text.Formats; import com.intellij.ui.AnimatedIcon; import com.redhat.devtools.intellij.lsp4ij.LanguageServerWrapper; import com.redhat.devtools.intellij.lsp4ij.ServerStatus; @@ -124,6 +124,6 @@ public String getDisplayName() { public String getElapsedTime() { long endTime = System.currentTimeMillis(); long duration = endTime - startTime; - return StringUtil.formatDuration(duration, "\u2009"); + return Formats.formatDuration(duration, "\u2009"); } } diff --git a/src/main/java/com/redhat/devtools/intellij/lsp4ij/lifecycle/LanguageServerLifecycleManager.java b/src/main/java/com/redhat/devtools/intellij/lsp4ij/lifecycle/LanguageServerLifecycleManager.java index 32b532747..f70871167 100644 --- a/src/main/java/com/redhat/devtools/intellij/lsp4ij/lifecycle/LanguageServerLifecycleManager.java +++ b/src/main/java/com/redhat/devtools/intellij/lsp4ij/lifecycle/LanguageServerLifecycleManager.java @@ -13,11 +13,11 @@ *******************************************************************************/ package com.redhat.devtools.intellij.lsp4ij.lifecycle; -import com.intellij.openapi.components.ServiceManager; import com.intellij.openapi.project.Project; import com.redhat.devtools.intellij.lsp4ij.LanguageServerWrapper; import org.eclipse.lsp4j.jsonrpc.MessageConsumer; import org.eclipse.lsp4j.jsonrpc.messages.Message; +import org.jetbrains.annotations.NotNull; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -29,8 +29,8 @@ */ public class LanguageServerLifecycleManager { - public static LanguageServerLifecycleManager getInstance(Project project) { - return ServiceManager.getService(project, LanguageServerLifecycleManager.class); + public static LanguageServerLifecycleManager getInstance(@NotNull Project project) { + return project.getService(LanguageServerLifecycleManager.class); } private static final Logger LOGGER = LoggerFactory.getLogger(LanguageServerLifecycleManager.class);//$NON-NLS-1$ diff --git a/src/main/java/com/redhat/devtools/intellij/lsp4ij/operations/diagnostics/LSPDiagnosticHandler.java b/src/main/java/com/redhat/devtools/intellij/lsp4ij/operations/diagnostics/LSPDiagnosticHandler.java index 012ef8130..2736de86f 100644 --- a/src/main/java/com/redhat/devtools/intellij/lsp4ij/operations/diagnostics/LSPDiagnosticHandler.java +++ b/src/main/java/com/redhat/devtools/intellij/lsp4ij/operations/diagnostics/LSPDiagnosticHandler.java @@ -30,6 +30,7 @@ import org.jetbrains.annotations.NotNull; import java.net.URI; +import java.util.concurrent.Callable; import java.util.function.Consumer; /** @@ -49,7 +50,7 @@ public LSPDiagnosticHandler(LanguageServerWrapper languageServerWrapper) { @Override public void accept(PublishDiagnosticsParams params) { Project project = languageServerWrapper.getProject(); - if (project.isDisposed()) { + if (project == null || project.isDisposed()) { return; } if (ApplicationManager.getApplication().isReadAccessAllowed()) { @@ -58,9 +59,11 @@ public void accept(PublishDiagnosticsParams params) { // Cancel if needed the previous "textDocument/publishDiagnostics" for a given uri. var coalesceBy = new CoalesceByKey("textDocument/publishDiagnostics", params.getUri()); var executeInSmartMode = DumbService.getInstance(languageServerWrapper.getProject()).isDumb(); - var action = ReadAction.nonBlocking(() -> updateDiagnostics(params, project)) - .expireWith(languageServerWrapper) - .coalesceBy(coalesceBy); + var action = ReadAction.nonBlocking((Callable) () -> { + updateDiagnostics(params, project); + return null; + }).expireWith(languageServerWrapper) + .coalesceBy(coalesceBy); if (executeInSmartMode) { action.inSmartMode(project); } diff --git a/src/main/java/com/redhat/devtools/intellij/lsp4mp4ij/classpath/ClasspathResourceChangedManager.java b/src/main/java/com/redhat/devtools/intellij/lsp4mp4ij/classpath/ClasspathResourceChangedManager.java index e840d5a07..58236fd60 100644 --- a/src/main/java/com/redhat/devtools/intellij/lsp4mp4ij/classpath/ClasspathResourceChangedManager.java +++ b/src/main/java/com/redhat/devtools/intellij/lsp4mp4ij/classpath/ClasspathResourceChangedManager.java @@ -16,7 +16,6 @@ import com.intellij.ProjectTopics; import com.intellij.openapi.Disposable; import com.intellij.openapi.application.ApplicationManager; -import com.intellij.openapi.components.ServiceManager; import com.intellij.openapi.module.Module; import com.intellij.openapi.project.Project; import com.intellij.openapi.roots.libraries.LibraryTablesRegistrar; @@ -26,9 +25,8 @@ import com.intellij.psi.PsiManager; import com.intellij.util.messages.MessageBusConnection; import com.intellij.util.messages.Topic; +import org.jetbrains.annotations.NotNull; -import java.util.ArrayList; -import java.util.List; import java.util.Set; /** @@ -56,8 +54,8 @@ public class ClasspathResourceChangedManager implements Disposable { private final MessageBusConnection appConnection; private final ClasspathResourceChangedListener listener; - public static ClasspathResourceChangedManager getInstance(Project project) { - return ServiceManager.getService(project, ClasspathResourceChangedManager.class); + public static ClasspathResourceChangedManager getInstance(@NotNull Project project) { + return project.getService(ClasspathResourceChangedManager.class); } public interface Listener { diff --git a/src/main/java/com/redhat/devtools/intellij/lsp4mp4ij/psi/core/project/AbstractConfigSource.java b/src/main/java/com/redhat/devtools/intellij/lsp4mp4ij/psi/core/project/AbstractConfigSource.java index cf8610d1e..47955a7ce 100644 --- a/src/main/java/com/redhat/devtools/intellij/lsp4mp4ij/psi/core/project/AbstractConfigSource.java +++ b/src/main/java/com/redhat/devtools/intellij/lsp4mp4ij/psi/core/project/AbstractConfigSource.java @@ -21,6 +21,7 @@ import java.io.IOException; import java.io.InputStream; +import java.nio.charset.Charset; import java.util.List; import java.util.Map; @@ -190,7 +191,7 @@ protected final T getConfig() { public void reload(PsiFile file) { reset(); String content = file.getText(); - try (InputStream input = IOUtils.toInputStream(content)) { + try (InputStream input = IOUtils.toInputStream(content, Charset.defaultCharset())) { config = loadConfig(input); lastModified = System.currentTimeMillis(); } catch (IOException e) { diff --git a/src/main/java/com/redhat/devtools/intellij/lsp4mp4ij/psi/core/project/PsiMicroProfileProjectManager.java b/src/main/java/com/redhat/devtools/intellij/lsp4mp4ij/psi/core/project/PsiMicroProfileProjectManager.java index 86566d2f6..f143d08b2 100644 --- a/src/main/java/com/redhat/devtools/intellij/lsp4mp4ij/psi/core/project/PsiMicroProfileProjectManager.java +++ b/src/main/java/com/redhat/devtools/intellij/lsp4mp4ij/psi/core/project/PsiMicroProfileProjectManager.java @@ -11,7 +11,6 @@ import com.intellij.ProjectTopics; import com.intellij.openapi.Disposable; -import com.intellij.openapi.components.ServiceManager; import com.intellij.openapi.module.Module; import com.intellij.openapi.module.ModuleManager; import com.intellij.openapi.project.ModuleListener; @@ -37,8 +36,8 @@ public final class PsiMicroProfileProjectManager implements Disposable { private static final String JAVA_FILE_EXTENSION = "java"; - public static PsiMicroProfileProjectManager getInstance(Project project) { - return ServiceManager.getService(project, PsiMicroProfileProjectManager.class); + public static PsiMicroProfileProjectManager getInstance(@NotNull Project project) { + return project.getService(PsiMicroProfileProjectManager.class); } private final MessageBusConnection connection; diff --git a/src/main/java/com/redhat/devtools/intellij/quarkus/QuarkusDeploymentSupport.java b/src/main/java/com/redhat/devtools/intellij/quarkus/QuarkusDeploymentSupport.java index 6da5a944c..eeb3e90b5 100644 --- a/src/main/java/com/redhat/devtools/intellij/quarkus/QuarkusDeploymentSupport.java +++ b/src/main/java/com/redhat/devtools/intellij/quarkus/QuarkusDeploymentSupport.java @@ -13,7 +13,6 @@ import com.intellij.openapi.Disposable; import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.application.WriteAction; -import com.intellij.openapi.components.ServiceManager; import com.intellij.openapi.module.Module; import com.intellij.openapi.module.ModuleManager; import com.intellij.openapi.progress.ProcessCanceledException; @@ -59,8 +58,8 @@ public class QuarkusDeploymentSupport implements ClasspathResourceChangedManager private final MessageBusConnection connection; private final Project project; - public static QuarkusDeploymentSupport getInstance(Project project) { - return ServiceManager.getService(project, QuarkusDeploymentSupport.class); + public static QuarkusDeploymentSupport getInstance(@NotNull Project project) { + return project.getService(QuarkusDeploymentSupport.class); } public QuarkusDeploymentSupport(Project project) { diff --git a/src/main/java/com/redhat/devtools/intellij/quarkus/QuarkusProjectService.java b/src/main/java/com/redhat/devtools/intellij/quarkus/QuarkusProjectService.java index 32a8649a5..b3fd5f294 100644 --- a/src/main/java/com/redhat/devtools/intellij/quarkus/QuarkusProjectService.java +++ b/src/main/java/com/redhat/devtools/intellij/quarkus/QuarkusProjectService.java @@ -13,7 +13,6 @@ import com.intellij.json.JsonFileType; import com.intellij.openapi.Disposable; import com.intellij.openapi.application.ApplicationManager; -import com.intellij.openapi.components.ServiceManager; import com.intellij.openapi.module.Module; import com.intellij.openapi.progress.EmptyProgressIndicator; import com.intellij.openapi.progress.ProcessCanceledException; @@ -32,6 +31,7 @@ import org.eclipse.lsp4mp.commons.MicroProfileProjectInfo; import org.eclipse.lsp4mp.commons.MicroProfilePropertiesScope; import org.eclipse.lsp4mp.utils.JSONSchemaUtils; +import org.jetbrains.annotations.NotNull; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -45,8 +45,8 @@ public class QuarkusProjectService implements ClasspathResourceChangedManager.Li private final Map> schemas = new ConcurrentHashMap<>(); - public static QuarkusProjectService getInstance(Project project) { - return ServiceManager.getService(project, QuarkusProjectService.class); + public static QuarkusProjectService getInstance(@NotNull Project project) { + return project.getService(QuarkusProjectService.class); } private final MessageBusConnection connection; diff --git a/src/main/java/com/redhat/devtools/intellij/quarkus/facet/QuarkusFrameworkDetector.java b/src/main/java/com/redhat/devtools/intellij/quarkus/facet/QuarkusFrameworkDetector.java index d9d67b9ea..5553df95e 100644 --- a/src/main/java/com/redhat/devtools/intellij/quarkus/facet/QuarkusFrameworkDetector.java +++ b/src/main/java/com/redhat/devtools/intellij/quarkus/facet/QuarkusFrameworkDetector.java @@ -13,8 +13,8 @@ import com.intellij.facet.FacetType; import com.intellij.framework.detection.FacetBasedFrameworkDetector; import com.intellij.framework.detection.FileContentPattern; +import com.intellij.ide.highlighter.XmlFileType; import com.intellij.openapi.fileTypes.FileType; -import com.intellij.openapi.fileTypes.StdFileTypes; import com.intellij.patterns.ElementPattern; import com.intellij.util.indexing.FileContent; import org.jetbrains.annotations.NotNull; @@ -34,7 +34,7 @@ public FacetType getFacetType() { @NotNull @Override public FileType getFileType() { - return StdFileTypes.XML; + return XmlFileType.INSTANCE; } @NotNull diff --git a/src/main/java/com/redhat/devtools/intellij/quarkus/gradle/AbstractGradleToolDelegate.java b/src/main/java/com/redhat/devtools/intellij/quarkus/gradle/AbstractGradleToolDelegate.java index 00d649c95..42488b8b9 100644 --- a/src/main/java/com/redhat/devtools/intellij/quarkus/gradle/AbstractGradleToolDelegate.java +++ b/src/main/java/com/redhat/devtools/intellij/quarkus/gradle/AbstractGradleToolDelegate.java @@ -13,7 +13,7 @@ import com.intellij.execution.RunManager; import com.intellij.execution.RunnerAndConfigurationSettings; import com.intellij.ide.util.newProjectWizard.AddModuleWizard; -import com.intellij.openapi.components.ServiceManager; +import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.externalSystem.model.settings.ExternalSystemExecutionSettings; import com.intellij.openapi.externalSystem.model.task.ExternalSystemTaskId; import com.intellij.openapi.externalSystem.model.task.ExternalSystemTaskType; @@ -49,11 +49,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import java.io.BufferedReader; -import java.io.File; -import java.io.IOException; -import java.io.Reader; -import java.io.Writer; +import java.io.*; import java.lang.reflect.InvocationTargetException; import java.nio.charset.StandardCharsets; import java.nio.file.Files; @@ -157,7 +153,7 @@ private String getModuleDirPath(Module module) { */ private void collectDependencies(Module module, Path customBuildFile, Path customSettingsFile, Path outputPath, List[] result) throws IOException { try { - final ExternalSystemFacadeManager manager = ServiceManager.getService(ExternalSystemFacadeManager.class); + final ExternalSystemFacadeManager manager = ApplicationManager.getApplication().getService(ExternalSystemFacadeManager.class); ExternalSystemExecutionSettings settings = ExternalSystemApiUtil.getExecutionSettings(module.getProject(), getModuleDirPath(module), diff --git a/src/main/java/com/redhat/devtools/intellij/quarkus/lsp/QuarkusServer.java b/src/main/java/com/redhat/devtools/intellij/quarkus/lsp/QuarkusServer.java index 26220a382..cec31d4b9 100644 --- a/src/main/java/com/redhat/devtools/intellij/quarkus/lsp/QuarkusServer.java +++ b/src/main/java/com/redhat/devtools/intellij/quarkus/lsp/QuarkusServer.java @@ -12,6 +12,7 @@ import com.intellij.ide.plugins.IdeaPluginDescriptor; import com.intellij.ide.plugins.PluginManager; +import com.intellij.ide.plugins.PluginManagerCore; import com.intellij.openapi.extensions.PluginId; import com.intellij.openapi.project.Project; import com.redhat.devtools.intellij.lsp4ij.server.JavaProcessCommandBuilder; @@ -23,6 +24,7 @@ import java.io.File; import java.net.URI; +import java.nio.file.Path; import java.util.Arrays; import java.util.HashMap; import java.util.List; @@ -39,13 +41,17 @@ public class QuarkusServer extends ProcessStreamConnectionProvider { public QuarkusServer(Project project) { this.project = project; - IdeaPluginDescriptor descriptor = PluginManager.getPlugin(PluginId.getId("com.redhat.devtools.intellij.quarkus")); - File lsp4mpServerPath = new File(descriptor.getPath(), "lib/server/org.eclipse.lsp4mp.ls-uber.jar"); - File quarkusServerPath = new File(descriptor.getPath(), "lib/server/com.redhat.quarkus.ls.jar"); + IdeaPluginDescriptor descriptor = PluginManagerCore.getPlugin(PluginId.getId("com.redhat.devtools.intellij.quarkus")); + assert descriptor != null; + Path pluginPath = descriptor.getPluginPath(); + assert pluginPath != null; + pluginPath = pluginPath.toAbsolutePath(); + Path lsp4mpServerPath = pluginPath.resolve("lib/server/org.eclipse.lsp4mp.ls-uber.jar"); + Path quarkusServerPath = pluginPath.resolve("lib/server/com.redhat.quarkus.ls.jar"); List commands = new JavaProcessCommandBuilder(project, "microprofile") - .setJar(lsp4mpServerPath.getAbsolutePath()) - .setCp(quarkusServerPath.getAbsolutePath()) + .setJar(lsp4mpServerPath.toString()) + .setCp(quarkusServerPath.toString()) .create(); commands.add("-DrunAsync=true"); super.setCommands(commands); diff --git a/src/main/java/com/redhat/devtools/intellij/qute/facet/QuteFrameworkDetector.java b/src/main/java/com/redhat/devtools/intellij/qute/facet/QuteFrameworkDetector.java index 602ceb653..71b5c6e18 100644 --- a/src/main/java/com/redhat/devtools/intellij/qute/facet/QuteFrameworkDetector.java +++ b/src/main/java/com/redhat/devtools/intellij/qute/facet/QuteFrameworkDetector.java @@ -13,8 +13,8 @@ import com.intellij.facet.FacetType; import com.intellij.framework.detection.FacetBasedFrameworkDetector; import com.intellij.framework.detection.FileContentPattern; +import com.intellij.ide.highlighter.XmlFileType; import com.intellij.openapi.fileTypes.FileType; -import com.intellij.openapi.fileTypes.StdFileTypes; import com.intellij.patterns.ElementPattern; import com.intellij.util.indexing.FileContent; import org.jetbrains.annotations.NotNull; @@ -34,7 +34,7 @@ public FacetType getFacetType() { @NotNull @Override public FileType getFileType() { - return StdFileTypes.XML; + return XmlFileType.INSTANCE; } @NotNull diff --git a/src/main/java/com/redhat/devtools/intellij/qute/lang/psi/QuteElementType.java b/src/main/java/com/redhat/devtools/intellij/qute/lang/psi/QuteElementType.java index f1c4bbcd2..422c9c6f8 100644 --- a/src/main/java/com/redhat/devtools/intellij/qute/lang/psi/QuteElementType.java +++ b/src/main/java/com/redhat/devtools/intellij/qute/lang/psi/QuteElementType.java @@ -22,6 +22,6 @@ public QuteElementType(@NonNls @NotNull String debugName) { @Override public String toString() { - return "QuteElementType." + getDebugName(); + return "QuteElementType." + super.toString(); } } diff --git a/src/main/java/com/redhat/devtools/intellij/qute/lsp/QuteServer.java b/src/main/java/com/redhat/devtools/intellij/qute/lsp/QuteServer.java index adf8cce26..1146a6808 100644 --- a/src/main/java/com/redhat/devtools/intellij/qute/lsp/QuteServer.java +++ b/src/main/java/com/redhat/devtools/intellij/qute/lsp/QuteServer.java @@ -12,6 +12,7 @@ import com.intellij.ide.plugins.IdeaPluginDescriptor; import com.intellij.ide.plugins.PluginManager; +import com.intellij.ide.plugins.PluginManagerCore; import com.intellij.openapi.extensions.PluginId; import com.intellij.openapi.project.Project; import com.redhat.devtools.intellij.lsp4ij.server.JavaProcessCommandBuilder; @@ -23,6 +24,7 @@ import java.io.File; import java.net.URI; +import java.nio.file.Path; import java.util.Arrays; import java.util.HashMap; import java.util.List; @@ -39,11 +41,14 @@ public class QuteServer extends ProcessStreamConnectionProvider { public QuteServer(Project project) { this.project = project; - IdeaPluginDescriptor descriptor = PluginManager.getPlugin(PluginId.getId("com.redhat.devtools.intellij.quarkus")); - File quteServerPath = new File(descriptor.getPath(), "lib/server/com.redhat.qute.ls-uber.jar"); + IdeaPluginDescriptor descriptor = PluginManagerCore.getPlugin(PluginId.getId("com.redhat.devtools.intellij.quarkus")); + assert descriptor != null; + Path pluginPath = descriptor.getPluginPath(); + assert pluginPath != null; + Path quteServerPath = pluginPath.toAbsolutePath().resolve("lib/server/com.redhat.qute.ls-uber.jar"); List commands = new JavaProcessCommandBuilder(project, "qute") - .setJar(quteServerPath.getAbsolutePath()) + .setJar(quteServerPath.toString()) .create(); commands.add("-DrunAsync=true"); super.setCommands(commands); diff --git a/src/main/resources/META-INF/lsp4ij.xml b/src/main/resources/META-INF/lsp4ij.xml index 6e9ed2fdc..c884e9c91 100644 --- a/src/main/resources/META-INF/lsp4ij.xml +++ b/src/main/resources/META-INF/lsp4ij.xml @@ -57,6 +57,7 @@ implementation="com.redhat.devtools.intellij.lsp4ij.operations.documentLink.LSPDocumentLinkGotoDeclarationHandler"/> +