Class: BELParser::Completion::NamespacePrefixCompleter

Inherits:
BaseCompleter
  • Object
show all
Defined in:
lib/bel_parser/completion.rb

Instance Method Summary collapse

Methods inherited from BaseCompleter

#initialize

Methods included from Parsers::AST::Sexp

#annotation_definition, #argument, #blank_line, build, #comment, #comment_line, #document_property, #domain, #function, #identifier, #keyword, #list, #list_item, #multi_identifier, #name, #namespace_definition, #nested_statement, #object, #observed_term, #parameter, #pattern, #prefix, #relationship, #set, #simple_statement, #statement, #string, #subject, #term, #unset, #uri, #url, #value

Constructor Details

This class inherits a constructor from BELParser::Completion::BaseCompleter

Instance Method Details

#complete(string_literal, _) ⇒ Object



719
720
721
722
723
724
725
726
727
# File 'lib/bel_parser/completion.rb', line 719

def complete(string_literal, _)
  lowercase_substring = string_literal.upcase
  @namespaces.keys
    .select  { |px| px.include?(lowercase_substring) }
    .sort
    .map     { |px|
      make_completion(px.upcase)
    }
end