diff --git a/lib/ruby_lsp/requests/completion.rb b/lib/ruby_lsp/requests/completion.rb index 019e3295d..ffd4c9e53 100644 --- a/lib/ruby_lsp/requests/completion.rb +++ b/lib/ruby_lsp/requests/completion.rb @@ -178,6 +178,7 @@ def build_method_completion(entry, node) text_edit: Interface::TextEdit.new(range: range_from_node(node), new_text: name), kind: Constant::CompletionItemKind::METHOD, label_details: Interface::CompletionItemLabelDetails.new( + detail: "(#{entry.parameters.map(&:decorated_name).join(", ")})", description: entry.file_name, ), documentation: markdown_from_index_entries(name, entry), diff --git a/test/requests/completion_test.rb b/test/requests/completion_test.rb index 8e1badd39..f7df5ef3c 100644 --- a/test/requests/completion_test.rb +++ b/test/requests/completion_test.rb @@ -494,6 +494,7 @@ def process assert_equal(["bar", "baz"], result.map(&:label)) assert_equal(["bar", "baz"], result.map(&:filter_text)) assert_equal(["bar", "baz"], result.map { |completion| completion.text_edit.new_text }) + assert_equal(["(a, b)", "(c, d)"], result.map { |completion| completion.label_details.detail }) end def test_completion_for_methods_named_with_uppercase_characters