Skip to content
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

Remove deprecated experimental features from global state #2829

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading