From 198c883ae0de9584fe464ca13238c426dfc7a012 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Koz=C5=82owski?= Date: Fri, 9 Jun 2023 16:59:02 +0200 Subject: [PATCH] Specify main class in launch options --- src/extension.ts | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/extension.ts b/src/extension.ts index feb4227..da26787 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -79,9 +79,16 @@ export function activate(context: ExtensionContext) { const launcher = ["launch", finalLanguageServerArtifact]; // m2Local is relevant when `gradle` is used to publish locally // coursier default resolvers are ivy2Local and maven central at the time of writing - const coursierOptions = ["--ttl", "1h", "--repository", "m2Local"].concat( - javaOptions - ); + const coursierOptions = [ + "--ttl", + "1h", + "--repository", + "m2Local", + // Necessary since the inclusion of Smithy CLI in the LS dependencies + "--main-class", + "software.amazon.smithy.lsp.Main", + ].concat(javaOptions); + const split = ["--"]; const lspArguments = ["0"]; // port 0 means we use std in/out to exchange with the language server const args = launcher.concat(coursierOptions, split, lspArguments);