-
Notifications
You must be signed in to change notification settings - Fork 28
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
Switch to rails runner
approach instead of Rack app
#256
Conversation
e8b0135
to
35ff940
Compare
41c27dc
to
c38937f
Compare
cf92da8
to
5515f70
Compare
5515f70
to
01047e0
Compare
rails runner
approach instead of Rack app
module RubyLsp | ||
module Rails | ||
class Railtie < ::Rails::Railtie | ||
config.ruby_lsp_rails = ActiveSupport::OrderedOptions.new |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's maybe keep the railtie so we can print deprecation warning for apps assigning config.ruby_lsp_rails.server
?
I think upgrading ruby-lsp-rails
and having the app blown up is not a good impression we want users to have.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was thinking that originally, but after discussing with @vinistock, probably very few apps are likely to be using this.
For Core, we can remove the setting when updating the gem.
We're also tagging this PR as a 'breaking change' for awareness.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're also tagging this PR as a 'breaking change' for awareness.
Yes, this and the version change will technically justify it, but they won't show up in the users' bump PR I think.
Given that:
- This addon was massively promoted by Chris Oliver recently
- Most Rails apps are private and won't show up in the GH search result
I don't want to underestimate the negative effect this may cause to our users, especially when it's actually not too costly to avoid.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I highly doubt a lot of people are turning off the server, but if you feel strongly about this we can add a deprecation warning and then remove it later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done (and verified against Code DB).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks 👍
I want to be super careful about this because I did already find 2 (though inactive) repos having this set just doing a quick search.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suppose people may also have disabled this because they didn't like the extra noise in their logs.
01047e0
to
77ae6c8
Compare
@@ -1,11 +1,7 @@ | |||
# typed: strict | |||
# frozen_string_literal: true | |||
|
|||
require "sorbet-runtime" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(sorbet-runtime
is already required by ruby-lsp
)
lib/ruby_lsp_rails/railtie.rb
Outdated
initializer "ruby_lsp_rails.setup" do |_app| | ||
config.after_initialize do |app| | ||
config.ruby_lsp_rails.server | ||
raise "not needed!" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's use a deprecation warning from Active Support instead. Otherwise, this will still break people's servers.
We can mention in the warning that the configuration can be removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, was just was just testing with this, it's now a deprecation.
f16624a
to
231cc6f
Compare
231cc6f
to
2f3457d
Compare
2f3457d
to
758ca85
Compare
This PR switches Ruby LSP to the new pipe approach rather than a mounted Rack server. (the runner was added already in #250).
This has several advantages, such as not needing the Rails server to be running. Previous discussion can be found in the prototype PR.
If an app was configured with
config.ruby_lsp_rails.server
, this setting is no longer used and should be removed.Note that there is currently no automatic reloading, so a change such as a database migration will not be visible until Ruby LSP is restarted.