From 1267727976b3f909caa54dd50ebc9d22d646d28c Mon Sep 17 00:00:00 2001 From: Fumiaki MATSUSHIMA Date: Thu, 17 Sep 2026 02:17:36 +0000 Subject: [PATCH] Count only enabled capabilities in the enabledFeatures array test When `enabledFeatures` is an array, absent features resolve to `false` and are passed as-is to `Interface::ServerCapabilities.new`. The test asserted the exact number of keys, relying on language_server-protocol dropping `false` values from the serialized capabilities. A future version of the language_server-protocol gem will keep `false` for optional properties and only omit `nil`, which is valid per the specification but changes the number of keys. Count only the capabilities that are not `false` so the test passes with either behavior. --- test/server_test.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/server_test.rb b/test/server_test.rb index 1301c8b59c..d320b67479 100644 --- a/test/server_test.rb +++ b/test/server_test.rb @@ -26,7 +26,7 @@ def test_initialize_enabled_features_with_array result = find_message(RubyLsp::Result, id: 1) hash = JSON.parse(result.response.to_json) - capabilities = hash["capabilities"] + capabilities = hash["capabilities"].select { _2 } # TextSynchronization + encodings + semanticHighlighting + range formatting + experimental assert_equal(5, capabilities.length)