Class: Yoda::Evaluation::CodeCompletion::ConstProvider

Inherits:
BaseProvider
  • Object
show all
Defined in:
lib/yoda/evaluation/code_completion/const_provider.rb

Instance Attribute Summary

Attributes inherited from BaseProvider

#registry, #source_analyzer

Instance Method Summary collapse

Methods inherited from BaseProvider

#initialize

Constructor Details

This class inherits a constructor from Yoda::Evaluation::CodeCompletion::BaseProvider

Instance Method Details

#candidatesArray<Model::CompletionItem>

Returns constant candidates by using the current lexical scope.

Returns:



12
13
14
15
16
17
18
19
20
21
# File 'lib/yoda/evaluation/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

Returns:

  • (true, false)


6
7
8
# File 'lib/yoda/evaluation/code_completion/const_provider.rb', line 6

def providable?
  !!current_ancestor_const_node
end