Skip to content

Commit

Permalink
deps: Update rbs to 3.0 (#662)
Browse files Browse the repository at this point in the history
* deps: Update rbs to 3.0

* spec: Use fileutils for testing Solargraph::Rbs::StdlibMap

The "set" has been merged into the Ruby Core and RBS has been drop
support since v3.0.  So current spec implementation will not work with
RBS-3.x.
  • Loading branch information
tk0miya authored Jan 8, 2025
1 parent 188577f commit 74fece0
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
12 changes: 6 additions & 6 deletions lib/solargraph/rbs_map/conversions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion solargraph.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
4 changes: 2 additions & 2 deletions spec/rbs_map/stdlib_map_spec.rb
Original file line number Diff line number Diff line change
@@ -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

Expand Down

0 comments on commit 74fece0

Please sign in to comment.