class Yoda::Evaluation::CommentCompletion::BaseProvider
@abstract
Attributes
ast[R]
@type ::Parser::AST::Node
comments[R]
@type Array<::Parser::Source::Comment>
location[R]
@type Location
registry[R]
@type Store::Registry
Public Class Methods
new(registry, ast, comments, location)
click to toggle source
@param registry [Store::Registry] @param ast [::Parser::AST::Node] @param comments [Array<::Parser::Source::Comment>] @param location [Location]
# File lib/yoda/evaluation/comment_completion/base_provider.rb, line 22 def initialize(registry, ast, comments, location) @registry = registry @ast = ast @comments = comments @location = location end
Public Instance Methods
available?()
click to toggle source
@abstract @return [true, false]
# File lib/yoda/evaluation/comment_completion/base_provider.rb, line 31 def available? fail NotImplementedError end
candidates()
click to toggle source
@abstract @return [Array<Model::CompletionItem>]
# File lib/yoda/evaluation/comment_completion/base_provider.rb, line 37 def candidates fail NotImplementedError end
Private Instance Methods
current_comment_query()
click to toggle source
@return [Parsing::Query::CurrentCommentQuery]
# File lib/yoda/evaluation/comment_completion/base_provider.rb, line 53 def current_comment_query @current_comment_query ||= Parsing::Query::CurrentCommentQuery.new(comments, location) end
current_comment_token_query()
click to toggle source
@return [Parsing::Query::CurrentCommentTokenQuery]
# File lib/yoda/evaluation/comment_completion/base_provider.rb, line 44 def current_comment_token_query @current_comment_token_query ||= Parsing::Query::CurrentCommentTokenQuery.new( current_comment_query.current_comment_block_text, current_comment_query.location_in_current_comment_block, ) end
current_commenting_node_query()
click to toggle source
@return [CurrentCommentingNodeQuery]
# File lib/yoda/evaluation/comment_completion/base_provider.rb, line 58 def current_commenting_node_query Parsing::Query::CurrentCommentingNodeQuery.new(ast, comments, location) end