diff --git a/lib/ruby_lsp/setup_bundler.rb b/lib/ruby_lsp/setup_bundler.rb index 846341ab8..a42c3e095 100644 --- a/lib/ruby_lsp/setup_bundler.rb +++ b/lib/ruby_lsp/setup_bundler.rb @@ -34,6 +34,7 @@ def stdout # Gems that should be kept up to date in the composed bundle. When updating, any of these gems that are not # already in the user's Gemfile will be updated together. GEMS_TO_UPDATE = ["ruby-lsp", "debug", "prism", "rbs"].freeze #: Array[String] + RUBY_LSP_MIN_VERSION = "0.18.0" #: String #: (String project_path, **untyped options) -> void def initialize(project_path, **options) @@ -170,9 +171,8 @@ def write_custom_gemfile end unless @dependencies["ruby-lsp"] - ruby_lsp_entry = +'gem "ruby-lsp"' - ruby_lsp_entry << ", \">= 0.a\"" if @beta - ruby_lsp_entry << ", require: false, group: :development" + version = @beta ? "0.a" : RUBY_LSP_MIN_VERSION + ruby_lsp_entry = +"gem \"ruby-lsp\", \">= #{version}\", require: false, group: :development" ruby_lsp_entry << ", github: \"Shopify/ruby-lsp\", branch: \"#{@branch}\"" if @branch parts << ruby_lsp_entry end