Class: Rucoa::Handlers::TextDocumentSelectionRangeHandler::SelectionRangeProvider
- Inherits:
-
Object
- Object
- Rucoa::Handlers::TextDocumentSelectionRangeHandler::SelectionRangeProvider
- Defined in:
- lib/rucoa/handlers/text_document_selection_range_handler.rb
Defined Under Namespace
Classes: NodeToRangesMapper
Class Method Summary collapse
Instance Method Summary collapse
- #call ⇒ Hash?
-
#initialize(position:, source:) ⇒ SelectionRangeProvider
constructor
A new instance of SelectionRangeProvider.
Constructor Details
#initialize(position:, source:) ⇒ SelectionRangeProvider
Returns a new instance of SelectionRangeProvider.
54 55 56 57 58 59 60 |
# File 'lib/rucoa/handlers/text_document_selection_range_handler.rb', line 54 def initialize( position:, source: ) @position = position @source = source end |
Class Method Details
.call(position:, source:) ⇒ Hash?
41 42 43 44 45 46 47 48 49 |
# File 'lib/rucoa/handlers/text_document_selection_range_handler.rb', line 41 def call( position:, source: ) new( position: position, source: source ).call end |
Instance Method Details
#call ⇒ Hash?
63 64 65 66 67 68 69 70 |
# File 'lib/rucoa/handlers/text_document_selection_range_handler.rb', line 63 def call ranges.reverse.reduce(nil) do |result, range| { parent: result, range: range.to_vscode_range } end end |