Class: Rucoa::Handlers::TextDocumentDocumentHighlightHandler::NodeToHighlightsMappers::LocalVariableMapper

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

Defined Under Namespace

Classes: UnshadowedNodeVisitor

Constant Summary collapse

SCOPE_BOUNDARY_NODE_TYPES =

Instance Method Summary collapse

Methods inherited from Base

call, #initialize

Constructor Details

This class inherits a constructor from Rucoa::Handlers::TextDocumentDocumentHighlightHandler::NodeToHighlightsMappers::Base

Instance Method Details

#callArray

Returns:

  • (Array)


379
380
381
382
383
384
385
386
387
388
# File 'lib/rucoa/handlers/text_document_document_highlight_handler.rb', line 379

def call
  nodes.map do |node|
    case node
    when Nodes::LvarNode
      Highlights::ReadHighlight
    when Nodes::ArgNode, Nodes::LvasgnNode
      Highlights::WriteHighlight
    end.new(parser_range: node.location.name)
  end
end