Sha256: c098cf9454c0365d8797d195daf8ee93895f6184ee6cbb04d3496ea19b21cf7a
Contents?: true
Size: 613 Bytes
Versions: 27
Compression:
Stored size: 613 Bytes
Contents
module Steep module ModuleHelper def module_name_from_node(node) case node.type when :const, :casgn namespace = namespace_from_node(node.children[0]) or return name = node.children[1] RBS::TypeName.new(name: name, namespace: namespace) end end def namespace_from_node(node) case node&.type when nil RBS::Namespace.empty when :cbase RBS::Namespace.root when :const namespace_from_node(node.children[0])&.yield_self do |parent| parent.append(node.children[1]) end end end end end
Version data entries
27 entries across 27 versions & 1 rubygems