-
Notifications
You must be signed in to change notification settings - Fork 138
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
Move gem RBI generation to server add-on #2174
Conversation
ce44c9a
to
ea38d97
Compare
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 is missing the plumbing to invoke
a00daf4
to
a2538f9
Compare
95e7e13
to
0773913
Compare
check = ::RubyLsp::Tapioca::RunGemRbiCheck.new(@project.absolute_path) | ||
check.run | ||
check.run { |gem| gem_list.concat(gem) } |
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 would be easier to verify if we had Mocha)
0773913
to
c4fdf4f
Compare
attr_reader :stdout | ||
attr_reader :stderr | ||
attr_reader :status | ||
attr_reader :log |
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.
(Renamed from stdout
)
The only place we read the logs now is the test, so it may be better to remove this.
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 logs in this file are useful no? Why don't we send them to the editor?
@@ -6,29 +6,28 @@ | |||
|
|||
module RubyLsp | |||
module Tapioca | |||
class RunGemRbiCheck | |||
class GemRbiCheck |
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.
(renamed as per Kaan's suggestion but we're open to other ideas)
@@ -57,10 +57,11 @@ class RunGemRbiCheckSpec < SpecWithProject | |||
@project.require_mock_gem(foo) | |||
@project.bundle_install! | |||
|
|||
check = ::RubyLsp::Tapioca::RunGemRbiCheck.new(@project.absolute_path) | |||
check.run | |||
gems_for_tapioca_command = [] |
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.
If we had Mocha we could write this as something like check.expects(:run).yields(["foo"])
attr_reader :stdout | ||
attr_reader :stderr | ||
attr_reader :status | ||
attr_reader :log |
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 logs in this file are useful no? Why don't we send them to the editor?
type: Constant::MessageType::WARNING, | ||
) unless gem_rbi_check.stderr.empty? | ||
gem_rbi_check = GemRbiCheck.new(T.must(@global_state).workspace_path) | ||
gem_rbi_check.run do |gems| |
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.
What do you think about this?
gem_rbi_check.run do |gems| | |
gem_generate.with_modified_gems do |gems| |
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.
How about on_gems_modified
? I think with
is more typically used as a 'wrapper'.
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.
Sure, I think gem_generate
better aligns with existing Tapioca commands too, let's make that change as well. Both for local variable and the class.
gem_rbi_check.stderr, | ||
type: Constant::MessageType::WARNING, | ||
) unless gem_rbi_check.stderr.empty? | ||
logger_callback = lambda do |message| |
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.
Named it to avoid confusion with the built-in Logger
.
Abandoning due to Bundler-related challenges, see https://github.com/Shopify/team-ruby-dx/issues/1372 |
As discussed internally, move this behaviour to the server add-on for consistency with the DSL add-on, and so that we can benefit by using
fork
.(13 seconds)