Class: RubyIndexer::Entry::UnresolvedConstantAlias
- Inherits:
-
RubyIndexer::Entry
- Object
- RubyIndexer::Entry
- RubyIndexer::Entry::UnresolvedConstantAlias
- Defined in:
- lib/ruby_indexer/lib/ruby_indexer/entry.rb
Overview
An UnresolvedAlias points to a constant alias with a right hand side that has not yet been resolved. For example, if we find
“‘ruby
CONST = Foo
“‘ Before we have discovered `Foo`, there’s no way to eagerly resolve this alias to the correct target constant. All aliases are inserted as UnresolvedAlias in the index first and then we lazily resolve them to the correct target in [Index#resolve]. If the right hand side contains a constant that doesn’t exist, then it’s not possible to resolve the alias and it will remain an UnresolvedAlias until the right hand side constant exists
Instance Attribute Summary collapse
-
#nesting ⇒ Object
readonly
: Array.
-
#target ⇒ Object
readonly
: String.
Attributes inherited from RubyIndexer::Entry
#location, #name, #uri, #visibility
Instance Method Summary collapse
-
#initialize(target, nesting, name, uri, location, comments) ⇒ UnresolvedConstantAlias
constructor
: (String target, Array nesting, String name, URI::Generic uri, Location location, String? comments) -> void.
Methods inherited from RubyIndexer::Entry
#comments, #file_name, #file_path, #private?, #protected?, #public?
Constructor Details
#initialize(target, nesting, name, uri, location, comments) ⇒ UnresolvedConstantAlias
: (String target, Array nesting, String name, URI::Generic uri, Location location, String? comments) -> void
370 371 372 373 374 375 |
# File 'lib/ruby_indexer/lib/ruby_indexer/entry.rb', line 370 def initialize(target, nesting, name, uri, location, comments) # rubocop:disable Metrics/ParameterLists super(name, uri, location, comments) @target = target @nesting = nesting end |
Instance Attribute Details
#nesting ⇒ Object (readonly)
: Array
367 368 369 |
# File 'lib/ruby_indexer/lib/ruby_indexer/entry.rb', line 367 def nesting @nesting end |
#target ⇒ Object (readonly)
: String
364 365 366 |
# File 'lib/ruby_indexer/lib/ruby_indexer/entry.rb', line 364 def target @target end |