Class: Yoda::Services::CommentCompletion::TypeProvider

Inherits:
BaseProvider
  • Object
show all
Defined in:
lib/yoda/services/comment_completion/type_provider.rb

Instance Attribute Summary

Attributes inherited from BaseProvider

#ast, #comments, #environment, #location

Instance Method Summary collapse

Methods inherited from BaseProvider

#initialize

Constructor Details

This class inherits a constructor from Yoda::Services::CommentCompletion::BaseProvider

Instance Method Details

#available?true, false

Returns:

  • (true, false)


6
7
8
# File 'lib/yoda/services/comment_completion/type_provider.rb', line 6

def available?
  [:type, :type_tag_type].include?(current_comment_token_query.current_state)
end

#candidatesArray<Model::CompletionItem>

Returns:



11
12
13
# File 'lib/yoda/services/comment_completion/type_provider.rb', line 11

def candidates
  description_candidates.map { |description| Model::CompletionItem.new(description: description, range: substitution_range) }
end