@@ -331,7 +331,7 @@ def bundle_install
331331 def update ( env )
332332 # Try to auto upgrade the gems we depend on, unless they are in the Gemfile as that would result in undesired
333333 # source control changes
334- gems = [ "ruby-lsp" , "debug" , "prism" ] . reject { |dep | @dependencies [ dep ] }
334+ gems = [ "ruby-lsp" , "debug" , "prism" , "rbs" ] . reject { |dep | @dependencies [ dep ] }
335335 gems << "ruby-lsp-rails" if @rails_app && !@dependencies [ "ruby-lsp-rails" ]
336336
337337 Bundler ::CLI ::Update . new ( { conservative : true } , gems ) . run
@@ -343,14 +343,15 @@ def update(env)
343343
344344 #: (Hash[String, String] env) -> Hash[String, String]
345345 def run_bundle_install_through_command ( env )
346- # If `ruby-lsp` and `debug` (and potentially `ruby-lsp-rails`) are already in the Gemfile, then we shouldn't try
347- # to upgrade them or else we'll produce undesired source control changes. If the composed bundle was just created
348- # and any of `ruby-lsp`, `ruby-lsp-rails` or `debug` weren't a part of the Gemfile, then we need to run `bundle
349- # install` for the first time to generate the Gemfile.lock with them included or else Bundler will complain that
350- # they're missing. We can only update if the custom `.ruby-lsp/Gemfile.lock` already exists and includes all gems
346+ # If `ruby-lsp`, `debug` and `rbs` (and potentially `ruby-lsp-rails`) are already in the Gemfile, then we
347+ # shouldn't try to upgrade them or else we'll produce undesired source control changes. If the composed bundle was
348+ # just created and any of `ruby-lsp`, `ruby-lsp-rails`, `debug` or `rbs` weren't a part of the Gemfile, then we
349+ # need to run `bundle install` for the first time to generate the Gemfile.lock with them included or else Bundler
350+ # will complain that they're missing. We can only update if the custom `.ruby-lsp/Gemfile.lock` already exists and
351+ # includes all gems
351352
352353 # When not updating, we run `(bundle check || bundle install)`
353- # When updating, we run `((bundle check && bundle update ruby-lsp debug) || bundle install)`
354+ # When updating, we run `((bundle check && bundle update ruby-lsp debug rbs ) || bundle install)`
354355 bundler_path = File . join ( Gem . default_bindir , "bundle" )
355356 base_command = ( !Gem . win_platform? && File . exist? ( bundler_path ) ? "#{ Gem . ruby } #{ bundler_path } " : "bundle" ) . dup
356357
@@ -361,12 +362,13 @@ def run_bundle_install_through_command(env)
361362 command = +"(#{ base_command } check"
362363
363364 if should_bundle_update?
364- # If any of `ruby-lsp`, `ruby-lsp-rails` or `debug ` are not in the Gemfile, try to update them to the latest
365- # version
365+ # If any of `ruby-lsp`, `ruby-lsp-rails`, `debug` or `rbs ` are not in the Gemfile, try to update them to the
366+ # latest version
366367 command . prepend ( "(" )
367368 command << " && #{ base_command } update "
368369 command << "ruby-lsp " unless @dependencies [ "ruby-lsp" ]
369370 command << "debug " unless @dependencies [ "debug" ]
371+ command << "rbs " unless @dependencies [ "rbs" ]
370372 command << "ruby-lsp-rails " if @rails_app && !@dependencies [ "ruby-lsp-rails" ]
371373 command . delete_suffix! ( " " )
372374 command << ")"
0 commit comments