Skip to content

Commit

Permalink
Remove deprecated experimental features from global state (#2829)
Browse files Browse the repository at this point in the history
  • Loading branch information
vinistock authored Nov 19, 2024
1 parent a3ed380 commit 6bdc52d
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 14 deletions.
4 changes: 1 addition & 3 deletions lib/ruby_lsp/global_state.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class GlobalState
attr_reader :encoding

sig { returns(T::Boolean) }
attr_reader :experimental_features, :top_level_bundle
attr_reader :top_level_bundle

sig { returns(TypeInferrer) }
attr_reader :type_inferrer
Expand All @@ -40,7 +40,6 @@ def initialize
@has_type_checker = T.let(true, T::Boolean)
@index = T.let(RubyIndexer::Index.new, RubyIndexer::Index)
@supported_formatters = T.let({}, T::Hash[String, Requests::Support::Formatter])
@experimental_features = T.let(false, T::Boolean)
@type_inferrer = T.let(TypeInferrer.new(@index), TypeInferrer)
@addon_settings = T.let({}, T::Hash[String, T.untyped])
@top_level_bundle = T.let(
Expand Down Expand Up @@ -131,7 +130,6 @@ def apply_options(options)
end
@index.configuration.encoding = @encoding

@experimental_features = options.dig(:initializationOptions, :experimentalFeaturesEnabled) || false
@client_capabilities.apply_client_capabilities(options[:capabilities]) if options[:capabilities]

addon_settings = options.dig(:initializationOptions, :addonSettings)
Expand Down
11 changes: 0 additions & 11 deletions test/global_state_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -188,17 +188,6 @@ def test_linter_auto_detection_with_rubocop_as_transitive_dependency
assert_includes(state.instance_variable_get(:@linters), "rubocop")
end

def test_apply_options_sets_experimental_features
state = GlobalState.new
refute_predicate(state, :experimental_features)

state.apply_options({
initializationOptions: { experimentalFeaturesEnabled: true },
})

assert_predicate(state, :experimental_features)
end

def test_type_checker_is_detected_based_on_transitive_sorbet_static
state = GlobalState.new

Expand Down

0 comments on commit 6bdc52d

Please sign in to comment.