Open
Description
Description
Ruby LSP Information
VS Code Version
1.95.3
Ruby LSP Extension Version
0.8.16
Ruby LSP Server Version
0.22.1
Ruby LSP Addons
- Ruby LSP RSpec
- Ruby LSP Rails
Ruby Version
3.3.6
Ruby Version Manager
none
Installed Extensions
Click to expand
- bash-ide-vscode (1.43.0)
- copilot (1.249.0)
- copilot-chat (0.22.4)
- gitlab-workflow (5.21.0)
- gitlens (16.0.5)
- gitmoji-vscode (1.2.5)
- gremlins (0.26.0)
- hexeditor (1.11.1)
- markdown-all-in-one (3.6.2)
- markdown-mermaid (1.27.0)
- ruby-lsp (0.8.16)
- sass-indented (1.8.31)
- shellcheck (0.37.1)
- sorbet-vscode-extension (0.3.37)
- sort-json (19.1.2)
- sql-formatter-vsc (4.1.3)
- svg (1.5.4)
- text-power-tools (1.50.0)
- todo-tree (0.0.226)
- vscode-env (0.1.0)
- vscode-eslint (3.0.10)
- vscode-gitweblinks (2.12.0)
- vscode-gutter-preview (0.32.2)
- vscode-rdbg (0.2.2)
- vscode-rubocop (0.7.0)
Ruby LSP Settings
Click to expand
Workspace
{
"rubyVersionManager": {
"identifier": "none"
},
"formatter": "none"
}
User
{
"enabledFeatures": {
"codeActions": true,
"diagnostics": true,
"documentHighlights": true,
"documentLink": true,
"documentSymbols": true,
"foldingRanges": true,
"formatting": true,
"hover": true,
"inlayHint": true,
"onTypeFormatting": true,
"selectionRanges": true,
"semanticHighlighting": true,
"completion": true,
"codeLens": true,
"definition": true,
"workspaceSymbol": true,
"signatureHelp": true,
"typeHierarchy": true
},
"featuresConfiguration": {},
"addonSettings": {},
"rubyVersionManager": {
"identifier": "none"
},
"customRubyCommand": "",
"formatter": "none",
"linters": null,
"bundleGemfile": "",
"testTimeout": 30,
"branch": "",
"pullDiagnosticsOn": "both",
"useBundlerCompose": false,
"bypassTypechecker": false,
"rubyExecutablePath": "",
"indexing": {},
"erbSupport": true,
"featureFlags": {}
}
Reproduction steps
- Start the Ruby LSP using a VSCode
- Open a Ruby file
- Find a code with a block returning a Hash like this one:
arr.map do |a|
{
id: a.id,
name: a.name
}
end
- We'd expect (or at least I do) the Hash to be preserved as it is and only the
do ... end
pairs to be turned into{ ... }
ones. Instead, we get this:
arr.map { |a| {; id: a.id,; name: a.name; } }
LSP reports no errors; thus, I assume the support for this operation needs improvements.
I was let know of the code for this operation to be here:
ruby-lsp/lib/ruby_lsp/requests/code_action_resolve.rb
Lines 305 to 332 in bbc1ccb