diff --git a/lib/bel/completion.rb b/lib/bel/completion.rb
index <HASH>..<HASH> 100644
--- a/lib/bel/completion.rb
+++ b/lib/bel/completion.rb
@@ -18,6 +18,10 @@ module BEL
       token_list = LibBEL::tokenize_term(term)
       active_tok, active_index = token_list.token_at(position)
 
+      # no active token indicates the position is out of
+      # range of all tokens in the list.
+      return [] unless active_tok
+
       tokens = token_list.to_a
       BEL::Completion::rules.reduce([]) { |completions, rule|
         completions.concat(rule.apply(tokens, active_tok, active_index))
no completion when position lies outside of tokens

when the caret position lies outside of the parsed BEL tokens then
completions are not possible, hence return empty array.

this rule should still apply when completing through to the full BEL
statement, as in that case we will have more tokens in the list.