From e471abbc4ee37012c0ea7b2ac9b6b9741de7ac6e Mon Sep 17 00:00:00 2001 From: Nicolas Berthier Date: Mon, 18 Sep 2023 16:35:49 +0200 Subject: [PATCH] Fix code for launching the LSP in VSCode platform --- .../superbol_languageclient.ml | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/src/vscode/superbol-vscode-platform/superbol_languageclient.ml b/src/vscode/superbol-vscode-platform/superbol_languageclient.ml index 008f44c4e..563d3a92e 100644 --- a/src/vscode/superbol-vscode-platform/superbol_languageclient.ml +++ b/src/vscode/superbol-vscode-platform/superbol_languageclient.ml @@ -12,21 +12,21 @@ (* *) (**************************************************************************) -let command = - Vscode.Workspace.getConfiguration () - |> Vscode.WorkspaceConfiguration.get ~section:"superbol.path" - |> function Some o -> Ojs.string_of_js o - | None -> "superbol" +let config = Vscode.Workspace.getConfiguration () -let args = ["x-lsp"] - -let serverOptions = Vscode_languageclient.ServerOptions.create +let serverOptions = + let command = + match Vscode.WorkspaceConfiguration.get ~section:"superbol.path" config with + | Some o -> Ojs.string_of_js o + | None -> "superbol-free" + in + Vscode_languageclient.ServerOptions.create () ~command - ~args - () - -let documentSelector = - [| `Filter (Vscode_languageclient.DocumentFilter.createLanguage ~language:"cobol" ()) |] - -let clientOptions = Vscode_languageclient.ClientOptions.create ~documentSelector () + ~args:["lsp"] +let clientOptions = + Vscode_languageclient.ClientOptions.create () + ~documentSelector:[| + `Filter (Vscode_languageclient.DocumentFilter.createLanguage () + ~language:"cobol"); + |]