From 0b635cdd8bc6751f10503a9074661c6477a86cab Mon Sep 17 00:00:00 2001 From: vinistock <18742907+vinistock@users.noreply.github.com> Date: Tue, 25 Feb 2025 20:25:43 +0000 Subject: [PATCH] Include tags in TestItem#to_hash (#3239) ### Motivation I forgot to include the new `tags` field in the `to_hash` response, which means we never return it to the extension. ### Implementation Added `tags` to `to_hash`. ### Automated Tests Updated tests. --- lib/ruby_lsp/requests/support/test_item.rb | 1 + test/response_builders/test_collection_test.rb | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/ruby_lsp/requests/support/test_item.rb b/lib/ruby_lsp/requests/support/test_item.rb index 53aeb76149..28dc7c7786 100644 --- a/lib/ruby_lsp/requests/support/test_item.rb +++ b/lib/ruby_lsp/requests/support/test_item.rb @@ -52,6 +52,7 @@ def to_hash label: @label, uri: @uri, range: @range, + tags: @tags, children: children.map(&:to_hash), } end diff --git a/test/response_builders/test_collection_test.rb b/test/response_builders/test_collection_test.rb index c5e08c0755..2e9cfaa5e9 100644 --- a/test/response_builders/test_collection_test.rb +++ b/test/response_builders/test_collection_test.rb @@ -46,7 +46,7 @@ def test_overrides_if_trying_to_add_item_with_same_id private def assert_expected_fields(hash) - [:id, :label, :uri, :range, :children].each do |field| + [:id, :label, :uri, :range, :children, :tags].each do |field| assert(hash[field]) end