def resolve(scope)
      current = scope

      constant_segments.each_with_index do |(type, name), index|
        type  = REMAP_TYPES.fetch(type, type)
        found = current.lookup(type, name, index == 0)

        if found and (found.const? or found.type == :root)
          current = found

        # Local variables and the likes.
        elsif found and found.value
          current = found.value

        else
          return
        end
      end

      return current
    end
def resolve(scope)
      current = scope

      constant_segments.each_with_index do |(type, name), index|
        type  = REMAP_TYPES.fetch(type, type)
        found = current.lookup(type, name, index == 0)

        if found and (found.const? or found.type == :root)
          current = found

        # Local variables and the likes.
        elsif found and found.value
          current = found.value

        else
          return
        end
      end

      return current
    end
@param [RubyLint::AST::Node] node


 Retrieves the definition associated with the constant path and returns
 it, or `nil` if no definition was found.

 @param [RubyLint::Definition::RubyObject] scope The scope to use for the
  lookups.
 @return [RubyLint::Definition::RubyObject|NilClass]