lib/steep/services/signature_help_provider.rb in steep-1.7.0.dev.2 vs lib/steep/services/signature_help_provider.rb in steep-1.7.0.dev.3

- old
+ new

@@ -17,10 +17,12 @@ arguments.push("**#{method_type.type.rest_keywords}") if method_type.type.rest_keywords arguments end end + include NodeHelper + attr_reader :source, :path, :subtyping, :typing, :buffer def env subtyping.factory.env end @@ -101,19 +103,14 @@ index = nil #: Integer? case call when MethodCall::Typed, MethodCall::Error type = call.receiver_type - if type.is_a?(AST::Types::Self) - type = context.self_type - end + config = Interface::Builder::Config.new(self_type: context.self_type, variable_bounds: context.variable_context.upper_bounds) - shape = subtyping.builder.shape( - type, - public_only: !node.children[0].nil?, - config: Interface::Builder::Config.new(self_type: type, class_type: nil, instance_type: nil, variable_bounds: {}) - ) - if shape + if shape = subtyping.builder.shape(type, config) + shape = shape.public_shape if private_send?(node) + if method = shape.methods[call.method_name] method.method_types.each.with_index do |method_type, i| defn = method_type.method_decls.to_a[0]&.method_def active_parameter = active_parameter_for(defn&.type, argument, last_argument, node)