145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
|
# File 'lib/bel/completion_rule.rb', line 145
def _apply(token_list, active_token, active_token_index, options = {})
if token_list.empty? or active_token.type == :O_PAREN
return SORTED_NAMESPACES.map { |ns_prefix|
map_namespace_prefix(ns_prefix)
}
end
return [] if active_token == token_list[0]
if active_token.type == :IDENT
value = active_token.value.downcase
return SORTED_NAMESPACES.find_all { |x|
x.downcase.include? value
}.map { |ns_prefix|
map_namespace_prefix(ns_prefix)
}
end
return EMPTY_MATCH
end
|