Skip to content

Commit 6bdc52d

Browse files
authored
Remove deprecated experimental features from global state (#2829)
1 parent a3ed380 commit 6bdc52d

File tree

2 files changed

+1
-14
lines changed

2 files changed

+1
-14
lines changed

lib/ruby_lsp/global_state.rb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class GlobalState
2121
attr_reader :encoding
2222

2323
sig { returns(T::Boolean) }
24-
attr_reader :experimental_features, :top_level_bundle
24+
attr_reader :top_level_bundle
2525

2626
sig { returns(TypeInferrer) }
2727
attr_reader :type_inferrer
@@ -40,7 +40,6 @@ def initialize
4040
@has_type_checker = T.let(true, T::Boolean)
4141
@index = T.let(RubyIndexer::Index.new, RubyIndexer::Index)
4242
@supported_formatters = T.let({}, T::Hash[String, Requests::Support::Formatter])
43-
@experimental_features = T.let(false, T::Boolean)
4443
@type_inferrer = T.let(TypeInferrer.new(@index), TypeInferrer)
4544
@addon_settings = T.let({}, T::Hash[String, T.untyped])
4645
@top_level_bundle = T.let(
@@ -131,7 +130,6 @@ def apply_options(options)
131130
end
132131
@index.configuration.encoding = @encoding
133132

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

137135
addon_settings = options.dig(:initializationOptions, :addonSettings)

test/global_state_test.rb

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -188,17 +188,6 @@ def test_linter_auto_detection_with_rubocop_as_transitive_dependency
188188
assert_includes(state.instance_variable_get(:@linters), "rubocop")
189189
end
190190

191-
def test_apply_options_sets_experimental_features
192-
state = GlobalState.new
193-
refute_predicate(state, :experimental_features)
194-
195-
state.apply_options({
196-
initializationOptions: { experimentalFeaturesEnabled: true },
197-
})
198-
199-
assert_predicate(state, :experimental_features)
200-
end
201-
202191
def test_type_checker_is_detected_based_on_transitive_sorbet_static
203192
state = GlobalState.new
204193

0 commit comments

Comments
 (0)