27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
# File 'lib/ruby_language_server/completion.rb', line 27
def completion(context, context_scope, position_scopes)
RubyLanguageServer.logger.debug("completion(#{context}, #{position_scopes.map(&:name)})")
completions =
if context.length < 2
scope_completions(context.first, position_scopes)
else
scope_completions_in_target_context(context, context_scope, position_scopes)
end
{
isIncomplete: true,
items: completions.uniq.map do |word, hash|
{
label: word,
kind: COMPLETION_ITEM_KIND[hash[:type]&.to_sym]
}
end
}
end
|