Module: BEL::Completion::Rule

Included in:
MatchFunctionRule, MatchNamespacePrefixRule, MatchNamespaceValueRule
Defined in:
lib/bel/completion_rule.rb

Overview

Rule defines the #apply API contract and additional helpers to convey completion actions.

Instance Method Summary collapse

Instance Method Details

#apply(token_list, active_token, active_token_index, options = {}) ⇒ Object



31
32
33
34
35
36
37
38
39
40
# File 'lib/bel/completion_rule.rb', line 31

def apply(token_list, active_token, active_token_index, options = {})
  matches = _apply(token_list, active_token, active_token_index, options)

  matches.map { |match|
    match = map_highlight(match, active_token)
    match = map_actions(match, active_token)
    match.delete(:offset)
    match
  }
end