-
Notifications
You must be signed in to change notification settings - Fork 156
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
Ruby LSP formatter is set to rubocop
but RuboCop was not found in the Gemfile or gemspec.
#2564
Comments
For the first error, is it possible to share the contents of your Gemfile? (you can redact any parts that are sensitive) For the second error, please try update to the latest ruby-lsp-rails release. |
Both errors are related to an old version of |
Thank you for your comments. The 2nd error was resolved by updating the gem. Thank you!!
However, the 1st error still remains.
Thanks, |
When I came across this error I tried to run rubocop on a file and it came out that it was failing. After Rubocop update it worked. Perhaps You need to update rubocop? |
That's a good point. We only support RuboCop integration starting with v1.4.0 or higher. If that's not the issue, then we have to start debugging to understand if the formatting requests are properly being set, what is being returned and so on. |
I updated rubocop from 1.56.4 to 1.66.1, rubocop-rails, rubocop-rspec, however unfortunately the 2nd error still remains. git diff are following.
Rubocop is working correctly when run via 'bundle exec'.
diff --git a/Gemfile.lock b/Gemfile.lock
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -125,3 +125,3 @@ GEM
barby (0.6.9)
- base64 (0.1.1)
+ base64 (0.2.0)
bcrypt (3.1.20)
@@ -161,3 +161,3 @@ GEM
coderay (1.1.3)
- concurrent-ruby (1.2.3)
+ concurrent-ruby (1.3.4)
config (5.4.0)
@@ -315,3 +315,3 @@ GEM
httpclient (2.8.3)
- i18n (1.14.4)
+ i18n (1.14.6)
concurrent-ruby (~> 1.0)
@@ -322,3 +322,3 @@ GEM
jmespath (1.6.2)
- json (2.7.1)
+ json (2.7.2)
json-schema (3.0.0)
@@ -385,3 +385,3 @@ GEM
mini_portile2 (2.8.7)
- minitest (5.22.3)
+ minitest (5.25.1)
msgpack (1.7.2)
@@ -423,6 +423,6 @@ GEM
os (1.1.4)
- parallel (1.24.0)
+ parallel (1.26.3)
paranoia (2.6.3)
activerecord (>= 5.1, < 7.2)
- parser (3.3.0.4)
+ parser (3.3.5.0)
ast (~> 2.4.1)
@@ -503,3 +503,3 @@ GEM
redis (4.7.1)
- regexp_parser (2.9.0)
+ regexp_parser (2.9.2)
reline (0.4.2)
@@ -551,4 +551,3 @@ GEM
rspec-support (3.13.1)
- rubocop (1.56.4)
- base64 (~> 0.1.1)
+ rubocop (1.66.1)
json (~> 2.3)
@@ -556,23 +555,17 @@ GEM
parallel (~> 1.10)
- parser (>= 3.2.2.3)
+ parser (>= 3.3.0.2)
rainbow (>= 2.2.2, < 4.0)
- regexp_parser (>= 1.8, < 3.0)
- rexml (>= 3.2.5, < 4.0)
- rubocop-ast (>= 1.28.1, < 2.0)
+ regexp_parser (>= 2.4, < 3.0)
+ rubocop-ast (>= 1.32.2, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 3.0)
- rubocop-ast (1.30.0)
- parser (>= 3.2.1.0)
- rubocop-capybara (2.20.0)
- rubocop (~> 1.41)
- rubocop-factory_bot (2.25.1)
- rubocop (~> 1.41)
- rubocop-rails (2.18.0)
+ rubocop-ast (1.32.3)
+ parser (>= 3.3.1.0)
+ rubocop-rails (2.26.1)
activesupport (>= 4.2.0)
rack (>= 1.1)
- rubocop (>= 1.33.0, < 2.0)
- rubocop-rspec (2.26.1)
- rubocop (~> 1.40)
- rubocop-capybara (~> 2.17)
- rubocop-factory_bot (~> 2.22)
+ rubocop (>= 1.52.0, < 2.0)
+ rubocop-ast (>= 1.31.1, < 2.0)
+ rubocop-rspec (3.0.5)
+ rubocop (~> 1.61)
ruby-progressbar (1.13.0)
@@ -642,3 +635,3 @@ GEM
execjs (>= 0.3.0, < 3)
- unicode-display_width (2.5.0)
+ unicode-display_width (2.6.0)
unicorn (6.1.0) |
@shrkw do you have any settings in |
ah yes, I don't have
|
If I understand it correctly, you have a separate Gemfile for RuboCop and you use If that's the case, then the reason we don't pick it up is because we override the If you want to use a separate Gemfile for development tools, like the linter and formatter, then you need to use the custom bundle gemfile configuration to point the Ruby LSP to that Gemfile. However, you will need to add the Please give that a try and if you're still having trouble, let us know. |
Yes, you are correct and I was able to get it working successfully by creating a custom bundle config. thank you very much!! |
Description
Ruby LSP and Rubocop assist does not work.
Ruby LSP Information
VS Code Version
1.93.1
Ruby LSP Extension Version
0.7.20
Ruby LSP Server Version
0.17.17
Ruby LSP Addons
Ruby Version
3.2.4
Ruby Version Manager
none
Installed Extensions
Click to expand
Ruby LSP Settings
Click to expand
Workspace
User
Reproduction steps
Then show following alert messages.
I have rubocop in the workspace.
$ bundle exec rubocop --version 1.56.4
Output Ruby LSP tab
When open Ruby file, then appear in Output Window tab.
The text was updated successfully, but these errors were encountered: