Sha256: 58e23615a53a3ef465150361998e5f063eff9c4fe0dadb5d0414e7f52a66e8bf
Contents?: true
Size: 1.23 KB
Versions: 4
Compression:
Stored size: 1.23 KB
Contents
module Yoda module Services class CommentCompletion class TagProvider < BaseProvider # @return [true, false] def available? current_comment_token_query.current_state == :tag end # @return [Array<Model::CompletionItem>] def candidates description_candidates.map { |description| Model::CompletionItem.new(description: description, range: substitution_range) } end private # @return [Array<Model::Descriptions::WordDescription>] def description_candidates return [] unless available? tagnames.select { |tagname| tagname.start_with?(index_word) }.map { |obj| Model::Descriptions::WordDescription.new(obj) } end # @return [Parsing::Range, nil] def substitution_range return nil unless available? current_comment_query.absolute_range(current_comment_token_query.current_range) end # @return [String] def index_word current_comment_token_query.current_word end # @return [Array<String>] def tagnames @tagnames ||= YARD::Tags::Library.labels.map { |tag_symbol, label| "@#{tag_symbol}" } end end end end end
Version data entries
4 entries across 4 versions & 1 rubygems