class Yoda::Evaluation::CodeCompletion::BaseProvider

@abstract Base class of completion candidates providers for code completion. This class bridges analysis features such as syntastic analysis {#analyzer} and symbolic execiton {#evaluator}.

Attributes

registry[R]

@return [Store::Registry]

source_analyzer[R]

@return [Parsing::SourceAnalyzer]

Public Class Methods

new(registry, source_analyzer) click to toggle source

@param registry [Store::Registry] @param source_analyzer [Parsing::SourceAnalyzer]

# File lib/yoda/evaluation/code_completion/base_provider.rb, line 16
def initialize(registry, source_analyzer)
  @registry = registry
  @source_analyzer = source_analyzer
end

Public Instance Methods

candidates() click to toggle source

@abstract @return [Array<Model::CompletionItem>]

# File lib/yoda/evaluation/code_completion/base_provider.rb, line 29
def candidates
  fail NotImplementedError
end
providable?() click to toggle source

@abstract @return [true, false]

# File lib/yoda/evaluation/code_completion/base_provider.rb, line 23
def providable?
  fail NotImplementedError
end

Private Instance Methods

analyzer() click to toggle source

@return [SourceAnalyzer]

# File lib/yoda/evaluation/code_completion/base_provider.rb, line 36
def analyzer
  @analyzer ||= Parsing::SourceAnalyzer.from_source(source, location)
end
ast() click to toggle source

@return [::Parser::AST::Node]

# File lib/yoda/evaluation/code_completion/base_provider.rb, line 46
def ast
  source_analyzer.ast
end
evaluator() click to toggle source

@return [Evaluator]

# File lib/yoda/evaluation/code_completion/base_provider.rb, line 41
def evaluator
  @evaluator ||= Evaluator.from_ast(registry, source_analyzer.ast, location)
end
location() click to toggle source

@return [Parsing::Location]

# File lib/yoda/evaluation/code_completion/base_provider.rb, line 51
def location
  source_analyzer.location
end