Sha256: 34af786bd8f916956b507e14ce57f39756270d27f1b97a6d1bfb2f0e23eebdfa

Contents?: true

Size: 966 Bytes

Versions: 31

Compression:

Stored size: 966 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 env: Environment

      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: (Symbol, context) -> TypeName?

      def partition: (TypeName) -> [Symbol, TypeName?]
    end
  end
end

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
rbs-3.7.0.dev.1 sig/resolver/type_name_resolver.rbs
rbs-3.6.1 sig/resolver/type_name_resolver.rbs
rbs-3.6.0 sig/resolver/type_name_resolver.rbs
rbs-3.6.0.pre.3 sig/resolver/type_name_resolver.rbs
rbs-3.6.0.pre.2 sig/resolver/type_name_resolver.rbs
rbs-3.6.0.pre.1 sig/resolver/type_name_resolver.rbs
rbs-3.6.0.dev.1 sig/resolver/type_name_resolver.rbs
rbs-3.5.3 sig/resolver/type_name_resolver.rbs
rbs-3.5.2 sig/resolver/type_name_resolver.rbs
rbs-3.5.1 sig/resolver/type_name_resolver.rbs
rbs-3.5.1.pre.1 sig/resolver/type_name_resolver.rbs
rbs-3.5.0 sig/resolver/type_name_resolver.rbs
rbs-3.5.0.pre.2 sig/resolver/type_name_resolver.rbs
rbs-3.5.0.pre.1 sig/resolver/type_name_resolver.rbs
rbs-3.4.4 sig/resolver/type_name_resolver.rbs
rbs-3.4.3 sig/resolver/type_name_resolver.rbs
rbs-3.4.2 sig/resolver/type_name_resolver.rbs
rbs-3.4.1 sig/resolver/type_name_resolver.rbs
rbs-3.4.0 sig/resolver/type_name_resolver.rbs
rbs-3.4.0.pre.1 sig/resolver/type_name_resolver.rbs