123456789_123456789_123456789_123456789_123456789_

Class: IRB::TypeCompletor

Do not use. This class is for internal use only.
Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
Instance Chain:
Inherits: IRB::BaseCompletor
Defined in: lib/irb/completion.rb

Constant Summary

BaseCompletor - Inherited

GEM_PATHS, ReservedWords

Class Method Summary

Instance Method Summary

Constructor Details

.new(context) ⇒ TypeCompletor

[ GitHub ]

  
# File 'lib/irb/completion.rb', line 105

def initialize(context)
  @context = context
end

Instance Method Details

#completion_candidates(preposing, target, _postposing, bind:)

[ GitHub ]

  
# File 'lib/irb/completion.rb', line 113

def completion_candidates(preposing, target, _postposing, bind:)
  commands = command_completions(preposing, target)
  result = ReplTypeCompletor.analyze(preposing + target, binding: bind, filename: @context.irb_path)
  return commands unless result

  commands | result.completion_candidates.map { target + _1 }
end

#doc_namespace(preposing, matched, _postposing, bind:)

[ GitHub ]

  
# File 'lib/irb/completion.rb', line 121

def doc_namespace(preposing, matched, _postposing, bind:)
  result = ReplTypeCompletor.analyze(preposing + matched, binding: bind, filename: @context.irb_path)
  result&.doc_namespace('')
end

#inspect

[ GitHub ]

  
# File 'lib/irb/completion.rb', line 109

def inspect
  ReplTypeCompletor.info
end