Class: Yoda::Evaluation::CommentCompletion
- Inherits:
-
Object
- Object
- Yoda::Evaluation::CommentCompletion
- Defined in:
- lib/yoda/evaluation/comment_completion.rb,
lib/yoda/evaluation/comment_completion/tag_provider.rb,
lib/yoda/evaluation/comment_completion/base_provider.rb,
lib/yoda/evaluation/comment_completion/type_provider.rb,
lib/yoda/evaluation/comment_completion/param_provider.rb
Defined Under Namespace
Classes: BaseProvider, ParamProvider, TagProvider, TypeProvider
Instance Attribute Summary collapse
-
#ast ⇒ Object
readonly
Returns the value of attribute ast.
-
#comments ⇒ Object
readonly
Returns the value of attribute comments.
-
#location ⇒ Object
readonly
Returns the value of attribute location.
-
#registry ⇒ Object
readonly
Returns the value of attribute registry.
Instance Method Summary collapse
- #available? ⇒ true, false
- #candidates ⇒ Array<Model::CompletionItem>
-
#initialize(registry, ast, comments, location) ⇒ CommentCompletion
constructor
A new instance of CommentCompletion.
Constructor Details
#initialize(registry, ast, comments, location) ⇒ CommentCompletion
Returns a new instance of CommentCompletion.
25 26 27 28 29 30 |
# File 'lib/yoda/evaluation/comment_completion.rb', line 25 def initialize(registry, ast, comments, location) @registry = registry @ast = ast @comments = comments @location = location end |
Instance Attribute Details
#ast ⇒ Object (readonly)
Returns the value of attribute ast.
13 14 15 |
# File 'lib/yoda/evaluation/comment_completion.rb', line 13 def ast @ast end |
#comments ⇒ Object (readonly)
Returns the value of attribute comments.
16 17 18 |
# File 'lib/yoda/evaluation/comment_completion.rb', line 16 def comments @comments end |
#location ⇒ Object (readonly)
Returns the value of attribute location.
19 20 21 |
# File 'lib/yoda/evaluation/comment_completion.rb', line 19 def location @location end |
#registry ⇒ Object (readonly)
Returns the value of attribute registry.
10 11 12 |
# File 'lib/yoda/evaluation/comment_completion.rb', line 10 def registry @registry end |
Instance Method Details
#available? ⇒ true, false
33 34 35 |
# File 'lib/yoda/evaluation/comment_completion.rb', line 33 def available? comment? && providers.any?(&:available?) end |
#candidates ⇒ Array<Model::CompletionItem>
38 39 40 |
# File 'lib/yoda/evaluation/comment_completion.rb', line 38 def candidates available? ? providers.select(&:available?).map(&:candidates).flatten : [] end |