Open ruggieroguida opened 3 years ago
What are your editor.formatOnSave
and editor.formatOnSaveMode
options?
If you use format on save for other languages, you can disable it for Ruby only in settings.json
, e.g.:
"[ruby]": {
"editor.formatOnSave": false
}
I'll still see if I can reproduce the error and make it work correctly. Do you get an error message and/or backtrace in the debug console (Help -> Toggle Developer Tools)?
I deleted the project folder and started again and it worked fine.
I managed to reproduce it though.
My new, working settings.json
(workspace) has only one line
{
"solargraph.formatting": true
}
If I add "editor.formatOnSave": true
it happens again.
The only message from the console is
[Extension Host] Config changed. Should lint: 1
when I change settings.json
Do you also have the rebornix.Ruby
extension installed? I suspect that's what sent the "Should lint: 1" message.
Nope. I cannot even find it on the marketplace actually
Oh :-)
Yes. I do
Related question that I didn't want to create a new issue for: Is the formatter intended to work with this setting?:
editor.formatOnSaveMode: 'modifications'
Setting info here: https://code.visualstudio.com/docs/getstarted/settings#_default-settings
Solargraph formatting works went it formats the whole file. It seems that rubocop doesn't support 'partial' formatting out of the box. (See: https://github.com/rubocop/rubocop/issues/5477)
OS: Bigsur vscode version: 1.63.2 Ruby 2.7.3 solargraph version: 0.44.3 extension version: v0.23.0
Have the exact same problem with two brand new, identical Ruby on Rails Apps (Rails 7).
Result:
"Saving 'anyfile.rb': Running 'Ruby Solargraph' Formatter (configure)."
// VSCode - Ruby Settings
// Extension: Ruby (Peng Lv)
"ruby.useBundler": true,
"ruby.useLanguageServer": false,
"ruby.format": false,
"[ruby]": {
// "editor.defaultFormatter": "rebornix.ruby"
"editor.defaultFormatter": "castwide.solargraph"
},
// Extension: Ruby Solargraph
"solargraph.logLevel": "info",
"solargraph.diagnostics": true,
"solargraph.useBundler": true,
"solargraph.formatting": true,
All of a sudden solargraph has stopped working. It is not allowing me to save any file and it gets stuck at
The only way to proceed is to click cancel. I literally cannot save any file. It has been working fine for years.
This is the content of
.solargraph.yml
. No change from the default oneAny suggestion?