15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
# File 'lib/holistic/ruby/autocompletion/suggest.rb', line 15
def call(code:, scope:)
lookup_scope = scope
if code.start_with?("::")
lookup_scope = lookup_scope.lexical_parent until lookup_scope.root?
end
if StartsWithLowerCaseLetter[code]
suggest_local_methods_from_current_scope(code:, scope: lookup_scope)
elsif code.include?(".")
suggest_methods_from_scope(code:, scope: lookup_scope)
else
suggest_namespaces_from_scope(code:, scope: lookup_scope)
end
end
|