Class: Yoda::Services::CodeCompletion::ConstProvider
- Inherits:
-
BaseProvider
- Object
- BaseProvider
- Yoda::Services::CodeCompletion::ConstProvider
- Defined in:
- lib/yoda/services/code_completion/const_provider.rb
Instance Attribute Summary
Attributes inherited from BaseProvider
#ast, #environment, #evaluator, #location
Instance Method Summary collapse
-
#candidates ⇒ Array<Model::CompletionItem>
Returns constant candidates by using the current lexical scope.
- #providable? ⇒ true, false
Methods inherited from BaseProvider
Constructor Details
This class inherits a constructor from Yoda::Services::CodeCompletion::BaseProvider
Instance Method Details
#candidates ⇒ Array<Model::CompletionItem>
Returns constant candidates by using the current lexical scope.
12 13 14 15 16 17 18 19 20 21 |
# File 'lib/yoda/services/code_completion/const_provider.rb', line 12 def candidates const_candidates.map do |const_candidate| Model::CompletionItem.new( description: Model::Descriptions::ValueDescription.new(const_candidate), range: substitution_range, kind: complete_item_kind(const_candidate), prefix: just_after_separator? ? '::' : '', ) end end |
#providable? ⇒ true, false
6 7 8 |
# File 'lib/yoda/services/code_completion/const_provider.rb', line 6 def providable? !!current_ancestor_const_node end |