lib/ruby_lsp/requests/support/common.rb in ruby-lsp-0.17.8 vs lib/ruby_lsp/requests/support/common.rb in ruby-lsp-0.17.9

- old
+ new

@@ -128,17 +128,21 @@ sig do params( title: String, entries: T.any(T::Array[RubyIndexer::Entry], RubyIndexer::Entry), max_entries: T.nilable(Integer), + extra_links: T.nilable(String), ).returns(String) end - def markdown_from_index_entries(title, entries, max_entries = nil) + def markdown_from_index_entries(title, entries, max_entries = nil, extra_links: nil) categorized_markdown = categorized_markdown_from_index_entries(title, entries, max_entries) + markdown = +(categorized_markdown[:title] || "") + markdown << "\n\n#{extra_links}" if extra_links + <<~MARKDOWN.chomp - #{categorized_markdown[:title]} + #{markdown} #{categorized_markdown[:links]} #{categorized_markdown[:documentation]} MARKDOWN @@ -201,9 +205,14 @@ when RubyIndexer::Entry::Accessor Constant::SymbolKind::PROPERTY when RubyIndexer::Entry::InstanceVariable Constant::SymbolKind::FIELD end + end + + sig { params(sorbet_level: Document::SorbetLevel).returns(T::Boolean) } + def sorbet_level_true_or_higher?(sorbet_level) + sorbet_level == Document::SorbetLevel::True || sorbet_level == Document::SorbetLevel::Strict end end end end end