Class: RubyIndexer::Index::Entry::UnresolvedAlias

Inherits:
RubyIndexer::Index::Entry show all
Extended by:
T::Sig
Defined in:
lib/ruby_indexer/lib/ruby_indexer/index.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

Attributes inherited from RubyIndexer::Index::Entry

#comments, #file_path, #location, #name, #visibility

Instance Method Summary collapse

Methods inherited from RubyIndexer::Index::Entry

#file_name

Constructor Details

#initialize(target, nesting, name, file_path, location, comments) ⇒ UnresolvedAlias

rubocop:disable Metrics/ParameterLists



312
313
314
315
316
317
# File 'lib/ruby_indexer/lib/ruby_indexer/index.rb', line 312

def initialize(target, nesting, name, file_path, location, comments) # rubocop:disable Metrics/ParameterLists
  super(name, file_path, location, comments)

  @target = target
  @nesting = nesting
end

Instance Attribute Details

#nestingObject (readonly)

Returns the value of attribute nesting.



300
301
302
# File 'lib/ruby_indexer/lib/ruby_indexer/index.rb', line 300

def nesting
  @nesting
end

#targetObject (readonly)

Returns the value of attribute target.



297
298
299
# File 'lib/ruby_indexer/lib/ruby_indexer/index.rb', line 297

def target
  @target
end