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

VSCode is giving me StandardRb issues (expected) and Rubocop issues (unexpected) #580

Open
germs12 opened this issue Aug 30, 2023 · 6 comments

Comments

@germs12
Copy link

germs12 commented Aug 30, 2023

I have removed Rubocop from my project and added StandardRb. I can have VSCode lint my files (and correct them) and it works as expected, but then moments later (sometimes 20 seconds, other times a couple minutes later) it will start reporting Rubocop issues that conflict with the StandardRb rules. Any idea how to get VSCode to just use StandardRb and ignore Rubocop?

I have searched the repo for anything rubocop and turned it off, but still no luck.

This is my .standard.yml

ruby_version: 3.2

plugins:
  - standard-rails

My gemfile has the following:

gem "standard", group: [:development, :test]
gem "standard-rails", group: [:development, :test]

In VSCode I have Ruby LSP installed and StandardRb. I do not have any Rubocop extensions install. Very frustrated. :)

Edit:

One clear example is double quotes vs single quotes. StandardRb gives me double quotes, but then I get an error that is should be single quotes.

@germs12
Copy link
Author

germs12 commented Aug 30, 2023

...I think this is because I had the Ruby LSP installed. Uninstalling it fixed the issue. (yay).

@searls
Copy link
Contributor

searls commented Aug 31, 2023

There is a setting on Ruby LSP to disable RuboCop.

We plan to add Standard support to it as well this year

@jamiemccarthy
Copy link
Contributor

For anyone else who finds this issue, the quick fix for Ruby LSP is to open its Extension Settings...

Screenshot 2023-10-13 at 15 55 03

"Edit in settings.json" the list of enabled LSP features...

Screenshot 2023-10-13 at 15 54 49

Set "diagnostics" to "false" and save.

Screenshot 2023-10-13 at 15 56 29

@abumalick
Copy link

For anyone else who finds this issue, the quick fix for Ruby LSP is to open its Extension Settings...

Screenshot 2023-10-13 at 15 55 03 "Edit in settings.json" the list of enabled LSP features... Screenshot 2023-10-13 at 15 54 49 Set "diagnostics" to "false" and save. Screenshot 2023-10-13 at 15 56 29

Thank you very much @jamiemccarthy . It would be good to include this in the Readme of this repository because it is really tricky to find how to disable robocop in rubyLsp. And most devs probably don't want to remove ruby-lsp extension completely.

@davidcelis
Copy link

Similarly, any update on adding Standard support to the now default ruby-lsp VSCode extension?

@searls
Copy link
Contributor

searls commented Feb 22, 2024

@davidcelis -- would love for someone to contribute this. I took a quick stab at it, but since I likely wouldn't use it myself I gave up at the first roadblock.

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

5 participants