Class: Steep::Locator::TypeApplicationResult

Inherits:
Data
  • Object
show all
Includes:
TypeNameLocator
Defined in:
lib/steep/locator.rb,
lib/steep/locator.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from TypeNameLocator

#type_name_at

Instance Attribute Details

#applicationObject (readonly)

Returns the value of attribute application

Returns:

  • (Object)

    the current value of application



32
33
34
# File 'lib/steep/locator.rb', line 32

def application
  @application
end

#nodeObject (readonly)

Returns the value of attribute node

Returns:

  • (Object)

    the current value of node



32
33
34
# File 'lib/steep/locator.rb', line 32

def node
  @node
end

Instance Method Details

#locate_type_name(position, nesting, subtyping, type_vars) ⇒ Object



62
63
64
65
66
67
68
69
70
71
72
73
# File 'lib/steep/locator.rb', line 62

def locate_type_name(position, nesting, subtyping, type_vars)
  application.each_rbs_type(nesting, subtyping, type_vars) do |type|
    location = type.location or raise
    if location.start_pos <= position && position <= location.end_pos
      if loc = type_name_at(position, type)
        return loc
      end
    end
  end

  nil
end