Class: Rucoa::Handlers::TextDocumentSelectionRangeHandler::SelectionRangeProvider::NodeToRangesMapper

Inherits:
Object
  • Object
show all
Defined in:
lib/rucoa/handlers/text_document_selection_range_handler.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(node) ⇒ NodeToRangesMapper

Returns a new instance of NodeToRangesMapper.

Parameters:



102
103
104
# File 'lib/rucoa/handlers/text_document_selection_range_handler.rb', line 102

def initialize(node)
  @node = node
end

Class Method Details

.call(node) ⇒ Array<Rucoa::Range>

Parameters:

Returns:



96
97
98
# File 'lib/rucoa/handlers/text_document_selection_range_handler.rb', line 96

def call(node)
  new(node).call
end

Instance Method Details

#callArray<Rucoa::Range>

Returns:



107
108
109
110
111
112
113
114
115
116
117
118
119
# File 'lib/rucoa/handlers/text_document_selection_range_handler.rb', line 107

def call
  case @node
  when Nodes::StrNode
    [
      inner_range,
      expression_range
    ]
  else
    [
      expression_range
    ]
  end
end