From 83ef8ae617ccd6adfeb4f923162723f70b54acc1 Mon Sep 17 00:00:00 2001 From: Pavel Marek Date: Mon, 23 Sep 2024 15:45:50 +0200 Subject: [PATCH] Test that engine-runner does not depend on language-server --- build.sbt | 1 - .../main/java/org/enso/runner/common/LanguageServerApi.java | 3 +++ .../java/org/enso/runner/EngineRunnerDependenciesTest.java | 3 --- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/build.sbt b/build.sbt index eced6412ae8..90c7291b923 100644 --- a/build.sbt +++ b/build.sbt @@ -3621,7 +3621,6 @@ lazy val `engine-runner` = project .dependsOn(`engine-runner-common`) .dependsOn(`polyglot-api`) .dependsOn(`enso-test-java-helpers`) - .dependsOn(`language-server` % Runtime) lazy val buildSmallJdk = taskKey[File]("Build a minimal JDK used for native image generation") diff --git a/engine/runner-common/src/main/java/org/enso/runner/common/LanguageServerApi.java b/engine/runner-common/src/main/java/org/enso/runner/common/LanguageServerApi.java index 4dcfc49ec38..848e59a9622 100644 --- a/engine/runner-common/src/main/java/org/enso/runner/common/LanguageServerApi.java +++ b/engine/runner-common/src/main/java/org/enso/runner/common/LanguageServerApi.java @@ -20,6 +20,9 @@ public abstract class LanguageServerApi { var it = ServiceLoader.load(LanguageServerApi.class, LanguageServerApi.class.getClassLoader()) .iterator(); + if (!it.hasNext()) { + throw new WrongOption("No language server implementation found"); + } var impl = it.next(); impl.runLanguageServer(line, config, logLevel); } diff --git a/engine/runner/src/test/java/org/enso/runner/EngineRunnerDependenciesTest.java b/engine/runner/src/test/java/org/enso/runner/EngineRunnerDependenciesTest.java index 74c8b0f75d1..e2b94408540 100644 --- a/engine/runner/src/test/java/org/enso/runner/EngineRunnerDependenciesTest.java +++ b/engine/runner/src/test/java/org/enso/runner/EngineRunnerDependenciesTest.java @@ -16,9 +16,6 @@ public class EngineRunnerDependenciesTest { public EngineRunnerDependenciesTest() {} @Test - // ignored for now as engine-runner still has "Runtime" dependency on language-server and that one - // appears in test classpath - remove once language-server is packaged as its own JAR file - @Ignore public void unableToLoadClassFromLanguageServerProject() { try { var b = new CommandLine.Builder();