diff --git a/lib/solargraph/rbs_map/conversions.rb b/lib/solargraph/rbs_map/conversions.rb index ecd5322f2..e52c94923 100644 --- a/lib/solargraph/rbs_map/conversions.rb +++ b/lib/solargraph/rbs_map/conversions.rb @@ -40,7 +40,7 @@ def convert_decl_to_pin decl, closure when RBS::AST::Declarations::Interface # STDERR.puts "Skipping interface #{decl.name.relative!}" interface_decl_to_pin decl - when RBS::AST::Declarations::Alias + when RBS::AST::Declarations::TypeAlias type_aliases[decl.name.to_s] = decl when RBS::AST::Declarations::Module module_decl_to_pin decl @@ -222,12 +222,12 @@ def method_def_to_pin decl, closure # @param decl [RBS::AST::Members::MethodDefinition] # @param pin [Pin::Method] def method_def_to_sigs decl, pin - decl.types.map do |type| - parameters, return_type = parts_of_function(type, pin) - block = if type.block - Pin::Signature.new(*parts_of_function(type.block, pin)) + decl.overloads.map do |overload| + parameters, return_type = parts_of_function(overload.method_type, pin) + block = if overload.method_type.block + Pin::Signature.new(*parts_of_function(overload.method_type.block, pin)) end - return_type = ComplexType.try_parse(method_type_to_tag(type)) + return_type = ComplexType.try_parse(method_type_to_tag(overload.method_type)) Pin::Signature.new(parameters, return_type, block) end end diff --git a/solargraph.gemspec b/solargraph.gemspec index 938720dc0..5d1c31b57 100755 --- a/solargraph.gemspec +++ b/solargraph.gemspec @@ -34,7 +34,7 @@ Gem::Specification.new do |s| s.add_runtime_dependency 'observer', '~> 0.1' s.add_runtime_dependency 'ostruct', '~> 0.6' s.add_runtime_dependency 'parser', '~> 3.0' - s.add_runtime_dependency 'rbs', '~> 2.0' + s.add_runtime_dependency 'rbs', '~> 3.0' s.add_runtime_dependency 'reverse_markdown', '~> 2.0' s.add_runtime_dependency 'rubocop', '~> 1.38' s.add_runtime_dependency 'thor', '~> 1.0' diff --git a/spec/rbs_map/stdlib_map_spec.rb b/spec/rbs_map/stdlib_map_spec.rb index 80734530a..8a3347653 100644 --- a/spec/rbs_map/stdlib_map_spec.rb +++ b/spec/rbs_map/stdlib_map_spec.rb @@ -1,7 +1,7 @@ describe Solargraph::RbsMap::StdlibMap do it "finds stdlib require paths" do - rbs_map = Solargraph::RbsMap::StdlibMap.load('set') - pin = rbs_map.path_pin('Set#add') + rbs_map = Solargraph::RbsMap::StdlibMap.load('fileutils') + pin = rbs_map.path_pin('FileUtils#chdir') expect(pin).to be end