Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions vscode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@
{
"command": "rubyLsp.selectRubyVersionManager",
"title": "Select Ruby version manager",
"category": "Ruby LSP"
"category": "Ruby LSP",
},
{
"command": "rubyLsp.toggleFeatures",
Expand Down Expand Up @@ -389,6 +389,7 @@
},
"rubyLsp.rubyVersionManager": {
"type": "object",
"scope": "window",
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ruby version manager could be different depending on workspaces.

"properties": {
"identifier": {
"description": "The Ruby version manager to use",
Expand Down Expand Up @@ -440,7 +441,7 @@
"rubyLsp.customRubyCommand": {
"description": "A shell command to activate the right Ruby version or add a custom Ruby bin folder to the PATH. Only used if rubyVersionManager is set to 'custom'",
"type": "string",
"scope": "machine"
"scope": "window"
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is safe to use window scope because untrusted workspace cannot execute command thanks to capabilities.untrustedWorkspaces options.

},
"rubyLsp.formatter": {
"description": "Which tool the Ruby LSP should use for formatting files",
Expand Down Expand Up @@ -478,7 +479,7 @@
"rubyLsp.bundleGemfile": {
"description": "Relative or absolute path to the Gemfile to use for bundling the Ruby LSP server. Do not use this if you're working on a monorepo or your project's Gemfile is in a subdirectory (look into multiroot workspaces instead). Only necessary when using a separate Gemfile for the Ruby LSP",
"type": "string",
"scope": "machine",
"scope": "window",
"default": ""
},
"rubyLsp.testTimeout": {
Expand Down Expand Up @@ -509,7 +510,7 @@
"rubyLsp.rubyExecutablePath": {
"description": "Path to the Ruby installation. This is used as a fallback if version manager activation fails",
"type": "string",
"scope": "machine"
"scope": "window"
},
"rubyLsp.indexing": {
"description": "Indexing configurations. Modifying these will impact which declarations are available for definition, completion and other features",
Expand Down
6 changes: 4 additions & 2 deletions vscode/src/ruby/custom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@ export class Custom extends VersionManager {

customCommand() {
const configuration = vscode.workspace.getConfiguration("rubyLsp");
const customCommand: string | undefined = configuration.get("customRubyCommand");

const inspectedCustomRubyCommand = configuration.inspect("customRubyCommand");
const customCommand = inspectedCustomRubyCommand.globalValue
?? inspectedCustomRubyCommand.workspaceValue
?? inspectedCustomRubyCommand.workspaceFolderValue
if (customCommand === undefined) {
throw new NonReportableError(
"The customRubyCommand configuration must be set when 'custom' is selected as the version manager. \
Expand Down
Loading