Skip to content

Commit

Permalink
Add setting to control usage of launcher
Browse files Browse the repository at this point in the history
  • Loading branch information
vinistock committed Oct 22, 2024
1 parent 4c523e3 commit b486b9f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
5 changes: 5 additions & 0 deletions vscode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
},
Expand Down
15 changes: 12 additions & 3 deletions vscode/src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
};
}
Expand Down

0 comments on commit b486b9f

Please sign in to comment.