-
Notifications
You must be signed in to change notification settings - Fork 225
Closed
Labels
bugSomething isn't workingSomething isn't workinghelp-wantedExtra attention is neededExtra attention is needed
Description
Operating System
Debian GNU/Linux 11 (bullseye), Docker Image (debian:bullseye-slim)
Ruby version
ruby 3.2.2 (2023-03-30 revision e51014f9c0) [x86_64-linux]
Project has a bundle
- Has bundle
Ruby version manager being used
no manager
Description
I am running VSCode and vscode-ruby-lsp in devcontainer, the Ruby LSP starts normally but formatting not working.
I already tweaked the "rubyLsp.formatter" in settiings.json, with values auto, rubocop or syntax_tree but was not lucky.
Project's Gemfile
# frozen_string_literal: true
source "https://rubygems.org"
group :development do
gem "rubocop"
gem "rubocop-discourse"
gem "syntax_tree"
gem "syntax_tree-disable_ternary"
end
.vscode/settings.json
{
"rubyLsp.rubyVersionManager": "none",
"rubyLsp.formatter": "rubocop",
"rubyLsp.yjit": true,
"rubyLsp.enableExperimentalFeatures": false,
"rubyLsp.enabledFeatures": {
"codeActions": false,
"diagnostics": false,
"documentHighlights": false,
"documentLink": false,
"documentSymbols": false,
"foldingRanges": false,
"formatting": true,
"hover": false,
"inlayHint": false,
"onTypeFormatting": false,
"selectionRanges": false,
"semanticHighlighting": false,
"completion": false,
"codeLens": false,
"definition": false
},
"[ruby]": {
"editor.defaultFormatter": "Shopify.ruby-lsp",
"editor.formatOnSave": true,
"editor.formatOnType": true,
"editor.tabSize": 2,
"files.trimTrailingWhitespace": true,
"files.trimFinalNewlines": true,
"editor.rulers": [120],
"editor.semanticHighlighting.enabled": true
},
"ruby lsp.trace.server": "verbose"
}
Ruby file content ensure has formatting issue
# test.rb
def say_hello
puts "Hello" # --> formatting: fixes the indentation on save
endMetadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workinghelp-wantedExtra attention is neededExtra attention is needed