-
Notifications
You must be signed in to change notification settings - Fork 178
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
RuboCop v1.70 incompatibilities and new RuboCop add-on #3046
Comments
#3045 fixed the namespace conflicts. |
Do you still think this should be reverted for now? I haven't tried it out myself yet, so no idea what the impact is. Most of the PR is good, just removing the addon itself to give more time shouldn't be too big of a ask I think. |
@vinistock Thank you for considering the migration plan for Ruby LSP. Ideally, in the future, it would be great if Ruby LSP could replace its dependency on RuboCop's internal APIs with RuboCop's Ruby LSP add-on. Interacting through only published interface is crucial for good design :-) Ideally, Ruby LSP should focus solely on LSP functionality. It would be ideal if Ruby LSP no longer needed to know the internal implementation of RuboCop's Linter/Formatter, allowing each module to concentrate on its intended role. I hope my understanding aligns with what you previously conveyed. That said, while the Ruby LSP add-on released with RuboCop 1.70 is honestly still insufficient to replace Ruby LSP's existing RuboCop dependency, I hope this serves as a starting point to gradually evolve the Ruby toolchain ecosystem toward its ideal form. Thank you. |
Yes, I agree. Having RuboCop control the integrations allows for the LSP integration and internal API to evolve side by side, which opens up the possibility for more complex changes. I created #3067, which addresses the first two points related to the formatter identifier conflict. Now, we just need to map if there are any feature differences to make the add-on match our internal integration. And, of course, keep the internal integration for a while since people on RuboCop < 1.70 will still need it. |
### Motivation This PR addresses point 1 and 2 from #3046 Now that the RuboCop add-on is using the `rubocop` identifier, we need to change ours to prevent conflicts, while still ensuring that users who are on older versions of RuboCop are getting the right behaviour. ### Implementation Essentially, we are changing our identifier to `rubocop_internal`. The only extra logic is falling back when users have explicitly configured their formatter or linter as `rubocop`. Since that is now owned by RuboCop, but only present on versions higher than v1.70, we need to check the version and ensure that it's actually available or fallback to our internal integration. ### Automated Tests Added tests.
Hi @vinistock thanks for the fixes. Do you know when the update will be available for VsCode? |
The releases were cut today https://github.com/Shopify/ruby-lsp/releases/tag/v0.23.6 and https://github.com/Shopify/ruby-lsp/releases/tag/vscode-ruby-lsp-v0.8.18. |
Yes it just appeared in the VsCode marketplace. But even by choosing
|
Please read this section on outdated versions of the server, it's likely your server that's outdated - not the extension. Let us know if you continue to have issues. |
I uninstalled all After uninstall
After re-install latest
In the output
|
The version that runs the server is specified in the bundle composed under the It using those techniques is not working, then some dependency of your app may be constraining the update, which is also explained in those docs. |
For me the vscode command
Which seems to be because .ruby-lsp/Gemfile.lock had the sorbet-runtine under a fontawesome remote. Removing the Gemfile.lock and running a bundle install and then update worked to fix it |
@bradsb please check your Bundler version is up-to-date. IIRC some older versions had problem with resolving to incorrect sources. |
I am running into the same issue. RubyLSP does not index anymore in one of my projects that is using Rubocop 1.70.0 and Standard 1.44.0 |
@celinefb did you already make sure the server is up to date? Are there errors being printed in the editor's output tab? |
I'm also still seeing the same error in my environment ( |
@dmoore1989 if you run |
@vinistock I'm actually seeing v0.17.16. It looks like ruby-lsp-rails was limiting it to Everything appears to be working now. Thanks! |
Hey. I'm trying to update the server version from 0.17.2 to the latest one running the Could you confirm if it's not being updated due to the stated "Unresolved or ambiguous specs" warnings?
|
@1990eam those warnings are not relevant, it's just because the LSP sets up the bundle on its own and Bundler emits some of these messages. Your problem seems to be the We depend on rbs >= 3 and your bundle seems to be locked to You have to ensure that you can update |
RuboCop v1.70 added an add-on to provide linting and formatting via the Ruby LSP. This is a great move long term, as it allows RuboCop maintainers to improve the integrations and ensure compatibility across versions.
Unfortunately, this first iteration of the add-on is conflicting with our internal integrations with RuboCop and may cause some issues. Namely, two things may happen:
Transition plan
We need a transition plan since people will still rely on our internal integrations while they are upgrading RuboCop. It may take a while until the community catches up to the newest versions.
Steps
rubocop
torubocop_internal
, it will avoid the conflict, but it also means that anyone who has configured to userubocop
will try to use the add-on. If the application is on an older version of RuboCop where the add-on is not available, that will fail and no formatting will be available. We can add logic to check for this scenario and try to do the right thing depending on what's availableThe text was updated successfully, but these errors were encountered: