class Solargraph::Source::Chain::Constant

def initialize word

def initialize word
  @word = word
end

def resolve api_map, name_pin, locals

def resolve api_map, name_pin, locals
  return [Pin::ROOT_PIN] if word.empty?
  if word.start_with?('::')
    context = ''
    bottom = word[2..-1]
  else
    context = name_pin.context.namespace
    bottom = word
  end
  if bottom.include?('::')
    ns = bottom.split('::')[0..-2].join('::')
  else
    ns = ''
  end
  api_map.get_constants(ns, context).select{|p| p.path.end_with?(bottom)}
end