class Yoda::Evaluation::CommentCompletion::TagProvider
Public Instance Methods
available?()
click to toggle source
@return [true, false]
# File lib/yoda/evaluation/comment_completion/tag_provider.rb, line 6 def available? current_comment_token_query.current_state == :tag end
candidates()
click to toggle source
@return [Array<Model::CompletionItem>]
# File lib/yoda/evaluation/comment_completion/tag_provider.rb, line 11 def candidates description_candidates.map { |description| Model::CompletionItem.new(description: description, range: substitution_range) } end
Private Instance Methods
description_candidates()
click to toggle source
@return [Array<Model::Descriptions::WordDescription>]
# File lib/yoda/evaluation/comment_completion/tag_provider.rb, line 18 def description_candidates return [] unless available? tagnames.select { |tagname| tagname.start_with?(index_word) }.map { |obj| Model::Descriptions::WordDescription.new(obj) } end
index_word()
click to toggle source
@return [String]
# File lib/yoda/evaluation/comment_completion/tag_provider.rb, line 30 def index_word current_comment_token_query.current_word end
substitution_range()
click to toggle source
@return [Parsing::Range, nil]
# File lib/yoda/evaluation/comment_completion/tag_provider.rb, line 24 def substitution_range return nil unless available? current_comment_query.absolute_range(current_comment_token_query.current_range) end
tagnames()
click to toggle source
@return [Array<String>]
# File lib/yoda/evaluation/comment_completion/tag_provider.rb, line 35 def tagnames @tagnames ||= YARD::Tags::Library.labels.map { |tag_symbol, label| "@#{tag_symbol}" } end