Skip to content

Conversation

@apiology
Copy link
Contributor

@apiology apiology commented Sep 26, 2025

Also replaces 'include' logic with call to ApiMap::Constants

Fixes #1099

Includes:

Also replaces 'include' logic with call to ApiMap::Constants

Fixes castwide#1099
@apiology
Copy link
Contributor Author

Interested to see if this creates the same perf problem as before...

@apiology apiology marked this pull request as draft September 26, 2025 17:10
@apiology
Copy link
Contributor Author

apiology commented Sep 26, 2025

The change in types in the solargraph-rails specs looks like an improvement to me - I'll make the change there, no need to wait on it. Specifically:

Hash#sum seems to do this sort of thing:

irb(main):006> {1=>"foo"}.sum([5])
[5, 1, "foo"]
irb(main):007> 

Before: (master branch with solargraph pin brought in)

broz@Mac:~/src/solargraph$ bundle exec solargraph pin --stack 'Hash{Integer => String}#sum'
#<Solargraph::Pin::Method `Enumerable#sum 
def sum: () -> (Elem | ::Integer)
       | sum: [T] () { [T] (arg0 Elem) -> T } -> (::Integer | T)
       | sum: [T] (?arg0 T) -> (Elem | T)
       | sum: [U] (?arg0 U) { [U] (arg0 Elem) -> U } -> U
` at #<Solargraph::Location /Users/broz/.rbenv/versions/3.1.6/lib/ruby/gems/3.1.0/gems/rbs-4.0.0.dev.4/core/enumerable.rbs, #<Solargraph::Range #<Solargraph::Position 1814, 2> to #<Solargraph::Position 1817, 50>>>) via :rbs>
broz@Mac:~/src/solargraph$ 

After this it's actually retaining types:

broz@Mac:~/src/solargraph$ bundle exec solargraph pin --stack 'Hash{Integer => String}#sum'
#<Solargraph::Pin::Method `Enumerable#sum 
def sum: () -> ([::Integer, ::String] | ::Integer)
       | sum: [T] () { [T] (arg0 [::Integer, ::String]) -> T } -> (::Integer | T)
       | sum: [T] (?arg0 T) -> ([::Integer, ::String] | T)
       | sum: [U] (?arg0 U) { [U] (arg0 [::Integer, ::String]) -> U } -> U
` at #<Solargraph::Location /Users/broz/.rbenv/versions/3.1.6/lib/ruby/gems/3.1.0/gems/rbs-4.0.0.dev.4/core/enumerable.rbs, #<Solargraph::Range #<Solargraph::Position 1814, 2> to #<Solargraph::Position 1817, 50>>>) via :rbs>
broz@Mac:~/src/solargraph$ 

@apiology apiology marked this pull request as ready for review September 26, 2025 20:27
…-specs' into try_again_removing_node_modules_stubs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

include Parser::NodeMethods not resolving

2 participants