Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

autoformat in vs code deleting comments #253

Closed
mutantcows opened this issue Aug 12, 2022 · 2 comments
Closed

autoformat in vs code deleting comments #253

mutantcows opened this issue Aug 12, 2022 · 2 comments

Comments

@mutantcows
Copy link

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
Copy link
Owner

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
Copy link
Author

Opened rubocop issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants