diff --git a/src/main/java/com/github/_1c_syntax/bsl/languageserver/BSLLSPLauncher.java b/src/main/java/com/github/_1c_syntax/bsl/languageserver/BSLLSPLauncher.java index a2a9e028f2f..0f6cfb922d6 100644 --- a/src/main/java/com/github/_1c_syntax/bsl/languageserver/BSLLSPLauncher.java +++ b/src/main/java/com/github/_1c_syntax/bsl/languageserver/BSLLSPLauncher.java @@ -28,7 +28,6 @@ import com.github._1c_syntax.bsl.languageserver.cli.WebsocketCommand; import com.github._1c_syntax.utils.CaseInsensitivePattern; import lombok.RequiredArgsConstructor; -import org.springframework.boot.CommandLineRunner; import org.springframework.boot.ExitCodeGenerator; import org.springframework.boot.SpringApplication; import org.springframework.boot.WebApplicationType; @@ -71,7 +70,7 @@ havingValue = "true", matchIfMissing = true) @RequiredArgsConstructor -public class BSLLSPLauncher implements Callable, CommandLineRunner, ExitCodeGenerator { +public class BSLLSPLauncher implements Callable, ExitCodeGenerator { private static final String DEFAULT_COMMAND = "lsp"; @@ -106,7 +105,10 @@ public static void main(String[] args) { var applicationContext = new SpringApplicationBuilder(BSLLSPLauncher.class) .web(getWebApplicationType(args)) .run(args); + var launcher = applicationContext.getBean(BSLLSPLauncher.class); + launcher.run(args); + if (launcher.getExitCode() >= 0) { System.exit( SpringApplication.exit(applicationContext) @@ -114,7 +116,6 @@ public static void main(String[] args) { } } - @Override public void run(String... args) { var cmd = new CommandLine(this, picocliFactory);