Skip to content

Commit

Permalink
Add supports_watching_files to GlobalState (#2811)
Browse files Browse the repository at this point in the history
  • Loading branch information
vinistock authored Oct 31, 2024
1 parent 2cd7b92 commit 297caf7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/ruby_lsp/global_state.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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) }
Expand Down
6 changes: 6 additions & 0 deletions test/global_state_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 297caf7

Please sign in to comment.