Class: RubyLsp::Requests::FoldingRanges
- Extended by:
- T::Generic, T::Sig
- Defined in:
- lib/ruby_lsp/requests/folding_ranges.rb
Overview

The [folding ranges](microsoft.github.io/language-server-protocol/specification#textDocument_foldingRange) request informs the editor of the ranges where and how code can be folded.
# Example
“‘ruby def say_hello # <– folding range start
puts "Hello"
end # <– folding range end “‘
Constant Summary collapse
- ResponseType =
type_member { { fixed: T::Array[Interface::FoldingRange] } }
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(comments, dispatcher) ⇒ FoldingRanges
constructor
A new instance of FoldingRanges.
- #perform ⇒ Object
Constructor Details
#initialize(comments, dispatcher) ⇒ FoldingRanges
Returns a new instance of FoldingRanges.
36 37 38 39 |
# File 'lib/ruby_lsp/requests/folding_ranges.rb', line 36 def initialize(comments, dispatcher) super() @listener = T.let(Listeners::FoldingRanges.new(comments, dispatcher), Listener[ResponseType]) end |
Class Method Details
.provider ⇒ Object
28 29 30 |
# File 'lib/ruby_lsp/requests/folding_ranges.rb', line 28 def provider Interface::FoldingRangeClientCapabilities.new(line_folding_only: true) end |
Instance Method Details
#perform ⇒ Object
42 43 44 |
# File 'lib/ruby_lsp/requests/folding_ranges.rb', line 42 def perform @listener.response end |