Sha256: a3162c100faeae89bf8811b3ec19dd1b712bc0ed5467cad7d1f0a41a4ec9e354

Contents?: true

Size: 876 Bytes

Versions: 28

Compression:

Stored size: 876 Bytes

Contents

module RBS
  module Resolver
    # TypeNameResolver resolves given relative type name to absolute type name under a module nesting context.
    #
    # The type name resolution doesn't take account of ancestors of modules.
    # It just ignores included modules and super classes.
    #
    class TypeNameResolver
      type query = [TypeName, context]

      def initialize: (Environment) -> void

      # Translates given type name to absolute type name.
      # Returns `nil` if cannot find associated type name.
      #
      def resolve: (TypeName, context: context) -> TypeName?

      private

      attr_reader all_names: Set[TypeName]

      attr_reader cache: Hash[query, TypeName?]

      def has_name?: (TypeName) -> TypeName?

      def try_cache: (query) { () -> TypeName? } -> TypeName?

      def resolve_in: (TypeName, context) -> TypeName?
    end
  end
end

Version data entries

28 entries across 28 versions & 2 rubygems

Version Path
getargv-0.3.3-universal-darwin vendor/bundle/ruby/3.3.0/gems/rbs-2.8.4/sig/resolver/type_name_resolver.rbs
rbs-3.1.1 sig/resolver/type_name_resolver.rbs
rbs-3.1.0 sig/resolver/type_name_resolver.rbs
rbs-3.0.4 sig/resolver/type_name_resolver.rbs
rbs-3.0.3 sig/resolver/type_name_resolver.rbs
rbs-3.0.2 sig/resolver/type_name_resolver.rbs
rbs-3.0.1 sig/resolver/type_name_resolver.rbs
rbs-3.0.0 sig/resolver/type_name_resolver.rbs
rbs-3.0.0.dev.3 sig/resolver/type_name_resolver.rbs
rbs-3.0.0.dev.2 sig/resolver/type_name_resolver.rbs
rbs-2.8.4 sig/resolver/type_name_resolver.rbs
rbs-2.8.3 sig/resolver/type_name_resolver.rbs
rbs-3.0.0.dev.1 sig/resolver/type_name_resolver.rbs
rbs-2.8.2 sig/resolver/type_name_resolver.rbs
rbs-2.8.1 sig/resolver/type_name_resolver.rbs
rbs-2.8.0 sig/resolver/type_name_resolver.rbs
rbs-2.8.0.pre.1 sig/resolver/type_name_resolver.rbs
rbs-2.7.0 sig/resolver/type_name_resolver.rbs
rbs-2.7.0.pre.3 sig/resolver/type_name_resolver.rbs
rbs-2.7.0.pre.2 sig/resolver/type_name_resolver.rbs