castwide / vscode-solargraph

A Visual Studio Code extension for Solargraph.
Other
423 stars 26 forks source link

autoformat in vs code deleting comments #253

Closed mutantcows closed 1 year ago

mutantcows commented 1 year ago

In VS Code with these settings:

{
  "[ruby]": {
    "editor.defaultFormatter": "castwide.solargraph"
  },
  "solargraph.formatting": true,
}

This snippet:

if var1
  # first important comment
  if var2
    # second important comment
  end
end

gets autoformatted to:

if var1 && var2
  # second important comment
end
castwide commented 1 year ago

This is probably specific to RuboCop, which currently provides Solargraph's formatting capabilities. (I'm working on a plugin architecture to allow selecting other formatters.)

mutantcows commented 1 year ago

Opened rubocop issue