class RubyLsp::ResponseBuilders::Hover
def empty?
def empty? @response.values.all?(&:empty?) end
def initialize
def initialize super @response = { title: +"", links: +"", documentation: +"", } #: Hash[Symbol, String] end
def push(content, category:)
def push(content, category:) hover_content = @response[category] if hover_content hover_content << content + "\n" end end
def response
@override
def response result = @response[:title] #: as !nil result << "\n" << @response[:links] if @response[:links] result << "\n" << @response[:documentation] if @response[:documentation] result.strip end