diff --git a/lib/ruby_lsp/global_state.rb b/lib/ruby_lsp/global_state.rb index 2ea0c3634..b17de2c18 100644 --- a/lib/ruby_lsp/global_state.rb +++ b/lib/ruby_lsp/global_state.rb @@ -159,6 +159,11 @@ def encoding_name end end + sig { returns(T::Boolean) } + def supports_watching_files + @client_capabilities.supports_watching_files + end + private sig { params(direct_dependencies: T::Array[String], all_dependencies: T::Array[String]).returns(String) } diff --git a/test/global_state_test.rb b/test/global_state_test.rb index 779cf2b65..4f96347cc 100644 --- a/test/global_state_test.rb +++ b/test/global_state_test.rb @@ -223,6 +223,12 @@ def test_addon_settings_are_stored assert_equal({ runtimeServerEnabled: false }, global_state.settings_for_addon("Ruby LSP Rails")) end + def test_delegates_supports_watching_files_to_client_capabilities + global_state = GlobalState.new + global_state.client_capabilities.expects(:supports_watching_files).returns(true) + global_state.supports_watching_files + end + private def stub_direct_dependencies(dependencies)