-
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
Add Rails Runner client #250
Conversation
|
||
sig { params(name: String).returns(T.nilable(T::Hash[Symbol, T.untyped])) } | ||
def model(name) | ||
make_request("model", name: name) |
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.
The param was called models
in the Rack app, which matched up with the RESTful route name, but here I think model
is more appropriate.
54cca6f
to
72f4c60
Compare
This still needs a little clean-up but feedback is welcome. |
56f75b8
to
afc4f28
Compare
afc4f28
to
a306d81
Compare
end | ||
|
||
sig { returns(T::Boolean) } | ||
def stopped? |
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.
To avoid the test having to poke inside with instance_var_get
.
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.
Awesome
end | ||
end | ||
|
||
RubyLsp::Rails::Server.new.start if ARGV.first == "start" |
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.
Do we need this argument? This script is always invoked from the runner, so would there be a case where we wouldn't want to start it?
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 can revisit this, but currently without it the check_docs
task will hang because it requires each file.
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 see. We can probably ignore this file in check_docs
.
} | ||
end | ||
|
||
schema_file = ActiveRecord::Tasks::DatabaseTasks.schema_dump_path(const.connection.pool.db_config) |
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.
This line break the compatibility with ActiveRecord 6
schema_dump_path
is not present in ActiveRecord 6.1: https://github.com/rails/rails/blob/v6.1.7.6/activerecord/lib/active_record/tasks/database_tasks.rb
schema_dump_path
is available from 7.0: https://github.com/rails/rails/blob/v7.0.0/activerecord/lib/active_record/tasks/database_tasks.rb#L448
[EDIT: open an issue #260]
This PR is part of a migration towards communicating with the Ruby LSP server over a pipe, rather than HTTP. It was copied out of the branch
andyw8/implement-lsp-runner
for easier review.I have tophatted the above branch against Code DB and Core. On Core, it correctly jumps the correct one of the two SQL structure files.
Previous discussion on prototype.