Class: Solargraph::Source::Chain::Head

Inherits:
Link
  • Object
show all
Defined in:
lib/solargraph/source/chain/head.rb

Overview

Note:

Chain::Head is only intended to handle `self` and `super`.

Chain::Head is a link for ambiguous words, e.g.; `String` can refer to either a class (`String`) or a function (`Kernel#String`).

Instance Attribute Summary

Attributes inherited from Link

#last_context, #word

Instance Method Summary collapse

Methods inherited from Link

#==, #constant?, #initialize, #undefined?

Constructor Details

This class inherits a constructor from Solargraph::Source::Chain::Link

Instance Method Details

#resolve(api_map, name_pin, locals) ⇒ Object


9
10
11
12
13
# File 'lib/solargraph/source/chain/head.rb', line 9

def resolve api_map, name_pin, locals
  return [Pin::ProxyType.anonymous(name_pin.binder)] if word == 'self'
  return super_pins(api_map, name_pin) if word == 'super'
  []
end