diff --git a/vscode/package.json b/vscode/package.json index 6ef12643a..afc141465 100644 --- a/vscode/package.json +++ b/vscode/package.json @@ -473,6 +473,11 @@ "description": "Enable ERB support. This can only work with server versions v0.17.5 or above", "type": "boolean", "default": true + }, + "rubyLsp.useLauncher": { + "description": "[EXPERIMENTAL] Uses server launcher for gracefully handling missing dependencies.", + "type": "boolean", + "default": false } } }, diff --git a/vscode/src/client.ts b/vscode/src/client.ts index 9def4acea..f5cb7ff03 100644 --- a/vscode/src/client.ts +++ b/vscode/src/client.ts @@ -62,6 +62,7 @@ function getLspExecutables( const customBundleGemfile: string = config.get("bundleGemfile")!; const useBundlerCompose: boolean = config.get("useBundlerCompose")!; const bypassTypechecker: boolean = config.get("bypassTypechecker")!; + const useLauncher: boolean = config.get("useLauncher")!; const executableOptions: ExecutableOptions = { cwd: workspaceFolder.uri.fsPath, @@ -98,17 +99,25 @@ function getLspExecutables( options: executableOptions, }; } else { - const argsWithBranch = branch.length > 0 ? ["--branch", branch] : []; + const args = []; + + if (branch.length > 0) { + args.push("--branch", branch); + } + + if (useLauncher) { + args.push("--use-launcher"); + } run = { command: "ruby-lsp", - args: argsWithBranch, + args, options: executableOptions, }; debug = { command: "ruby-lsp", - args: argsWithBranch.concat(["--debug"]), + args: args.concat(["--debug"]), options: executableOptions, }; }