Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
111 commits
Select commit Hold shift + click to select a range
6acfa0c
RuboCop todo file stability
apiology Aug 30, 2025
14be6bf
Merge remote-tracking branch 'origin/master' into rubocop_stability
apiology Aug 30, 2025
61260f3
Fix merge issue
apiology Aug 30, 2025
f632481
Centralize all pin-caching logic in PinCache
apiology Sep 3, 2025
c7b66cf
Exclude more scenarios that RBS does not support
apiology Sep 4, 2025
eb676b7
Fix indentation
apiology Sep 4, 2025
8ea2104
Adjust comment location
apiology Sep 4, 2025
2b3152e
Ensure using latest RBS version in undercover
apiology Sep 4, 2025
1b644b4
Add regression specs
apiology Sep 4, 2025
102f711
Merge branch 'rubocop_stability' into add_regression_specs
apiology Sep 4, 2025
71c2db0
Merge branch 'add_regression_specs' into pin_cache_refactor
apiology Sep 4, 2025
aafaa5d
Ensure overrides are handled properly regardless of state of pin
apiology Sep 4, 2025
e2ba569
Lint fixes
apiology Sep 4, 2025
adde97d
Merge remote-tracking branch 'origin/master' into pin_cache_refactor
apiology Sep 6, 2025
8edc773
Merge remote-tracking branch 'origin/master' into rubocop_stability
apiology Sep 6, 2025
bb0f607
Rerun rubocop todo
apiology Sep 6, 2025
7cb3edd
Merge branch 'master' into pin_cache_refactor
apiology Sep 7, 2025
837d7f6
Force build
apiology Sep 7, 2025
a4208e7
Restore
apiology Sep 7, 2025
f08b76a
Merge remote-tracking branch 'origin/master' into fix_solargraph_rspe…
apiology Sep 7, 2025
b66f2ac
install -> update with rbs collection
apiology Sep 7, 2025
a09a9af
Try Ruby 3.2
apiology Sep 7, 2025
6fc8feb
Update solargraph
apiology Sep 7, 2025
388c170
Re-add bundle install
apiology Sep 7, 2025
f80b73a
Drop MATRIX_SOLARGRAPH_VERSION
apiology Sep 7, 2025
ce2bee6
Drop debugging changes
apiology Sep 7, 2025
c261704
Merge remote-tracking branch 'origin/master' into rubocop_stability
apiology Sep 7, 2025
dbe9a3e
Update expectations from master branch
apiology Sep 7, 2025
620fa00
Merge branch 'fix_solargraph_rspec_check' into rubocop_stability
apiology Sep 7, 2025
217fecd
Update expectations from master branch
apiology Sep 7, 2025
2d2f0a7
install -> update with rbs collection
apiology Sep 7, 2025
3db4b1f
Try Ruby 3.2
apiology Sep 7, 2025
faa6428
Update solargraph
apiology Sep 7, 2025
3f68a02
Re-add bundle install
apiology Sep 7, 2025
b8c1605
Drop MATRIX_SOLARGRAPH_VERSION
apiology Sep 7, 2025
d3a0c36
Drop debugging changes
apiology Sep 7, 2025
9b713b2
Fix combined gem cache implementation
apiology Sep 9, 2025
1b12d27
Merge branch 'master' into rubocop_stability
apiology Sep 13, 2025
db725f7
Update rubocop todo
apiology Sep 13, 2025
84c605a
Merge branch 'master' into pin_cache_refactor
apiology Sep 13, 2025
743b71c
Merge branch 'rubocop_stability' into pin_cache_refactor
apiology Sep 13, 2025
64de402
Merge branch 'master' into pin_cache_refactor
apiology Sep 16, 2025
a398b84
Resolve constants in references
apiology Sep 26, 2025
dd06a47
Linting
apiology Sep 26, 2025
cc86aec
Ratchet RuboCop
apiology Sep 26, 2025
343cd23
Fix lack of parameters in include types
apiology Sep 26, 2025
d787886
Bug fixes
apiology Sep 26, 2025
63a53db
Add actual type for Mutexes
apiology Sep 26, 2025
7546f73
Enable solargraph-rspec tests
lekemula Sep 21, 2025
9c79e5b
Fix rspec gems specs
lekemula Sep 21, 2025
1416e1d
Reduce number of build jobs for faster CI feedback
apiology Sep 28, 2025
f2abb73
Fix punctuation
apiology Sep 28, 2025
879eac3
Merge branch 'master' into reduce_num_of_buid_jobs
apiology Sep 30, 2025
004b7a4
Merge remote-tracking branch 'origin/master' into pin_cache_refactor
apiology Sep 30, 2025
eabe151
Update rubocop todo
apiology Sep 30, 2025
ce3ce8c
Fix merge issue
apiology Sep 30, 2025
a6bdfd6
Drop no-longer-needed @sg-ignores
apiology Sep 30, 2025
523ca94
Merge remote-tracking branch 'origin/master' into try_again_removing_…
apiology Sep 30, 2025
d486e64
Trim more matrix entries to make room for solargraph-rspec specs
apiology Oct 1, 2025
56342d4
Fix version number
apiology Oct 1, 2025
df0c1db
Merge remote-tracking branch 'lekemula/enable-solargraph-rspec-plugin…
apiology Oct 1, 2025
096ff16
Merge remote-tracking branch 'origin/master' into pin_cache_refactor
apiology Oct 6, 2025
88e1f73
Fix merge
apiology Oct 6, 2025
81ae528
CLI 'solargraph gems' improvements
apiology Oct 6, 2025
915c5aa
Allow PR to build
apiology Oct 6, 2025
9e29680
Drop spec
apiology Oct 6, 2025
7b49823
Add space for better future merge
apiology Oct 8, 2025
d9fa32f
Fix a Gem::Specification class limitation found on another branch
apiology Oct 8, 2025
f4f1620
Fix RuboCop issues
apiology Oct 8, 2025
bf95071
Restore actions config
apiology Oct 8, 2025
6b9bce8
Annotation fixes
apiology Dec 1, 2025
11ae178
Merge branch 'pin_cache_refactor' into improve_solargraph_gems
apiology Dec 1, 2025
fca1082
Remove @sg-ignore
apiology Dec 1, 2025
2d92d80
Merge branch 'pin_cache_refactor' into improve_solargraph_gems
apiology Dec 1, 2025
9e7bdc7
Merge remote-tracking branch 'origin/master' into pin_cache_refactor
apiology Dec 31, 2025
95b76c3
Fix merge
apiology Dec 31, 2025
e935c97
Fix RuboCop
apiology Dec 31, 2025
f5c63aa
Fix strong typechecking issues
apiology Dec 31, 2025
0b4e419
Merge remote-tracking branch 'origin/master' into try_again_removing_…
apiology Dec 31, 2025
a497e42
Merge remote-tracking branch 'origin/master' into reduce_num_of_buid_…
apiology Dec 31, 2025
2b753e8
Bump RBS versions in rspec test
apiology Dec 31, 2025
e182a53
Fix version
apiology Dec 31, 2025
34cdf78
Fix version matrix
apiology Dec 31, 2025
851d142
Fix version matrix
apiology Dec 31, 2025
e2d27c9
Fix version matrix
apiology Dec 31, 2025
8df808a
Fix version matrix
apiology Dec 31, 2025
9974481
Fix version matrix
apiology Dec 31, 2025
56e2535
Exclude another
apiology Dec 31, 2025
d9e4936
Exclude another
apiology Dec 31, 2025
7514302
Add version, fix doc
apiology Dec 31, 2025
3b58706
Merge remote-tracking branch 'origin/master' into pin_cache_refactor
apiology Jan 1, 2026
5117745
Merge remote-tracking branch 'origin/master' into try_again_removing_…
apiology Jan 1, 2026
4aaf0be
Merge branch 'reduce_num_of_buid_jobs' into pin_cache_refactor
apiology Jan 1, 2026
1f0c11d
Fix merge
apiology Jan 2, 2026
25b1148
Don't use solargraph-rspec branch
apiology Jan 2, 2026
f44141c
Fix merge
apiology Jan 2, 2026
9798505
Debug
apiology Jan 2, 2026
20e9649
Merge branch 'try_again_removing_node_modules_stubs' into pin_cache_r…
apiology Jan 2, 2026
93d8e53
Merge remote-tracking branch 'origin/master' into pin_cache_refactor
apiology Jan 2, 2026
5edcd2d
Add another use of stdlib dependencies in RBS
apiology Jan 2, 2026
8320f5b
Mock additional call
apiology Jan 2, 2026
6730e8f
Fix annotations
apiology Jan 2, 2026
9a88f53
Update types in rspec undercover
apiology Jan 2, 2026
00c2947
Debug
apiology Jan 2, 2026
5df17d5
Debug
apiology Jan 2, 2026
c22e310
Drop incorrect rbs collection use in spec
apiology Jan 2, 2026
e70af06
Merge branch 'pin_cache_refactor' into improve_solargraph_gems
apiology Jan 2, 2026
c4a91f4
Fix issues resolving cgi escape functions
apiology Jan 10, 2026
02151a5
Be more careful marking things as stdlib
apiology Jan 10, 2026
14a8468
Reclassify rbs gem
apiology Jan 10, 2026
b0b8368
Merge branch 'pin_cache_refactor' into improve_solargraph_gems
apiology Jan 10, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions .github/workflows/plugins.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,9 @@ jobs:
- name: clone https://github.com/lekemula/solargraph-rspec/
run: |
cd ..
# git clone https://github.com/lekemula/solargraph-rspec.git
git clone https://github.com/lekemula/solargraph-rspec.git

# pending https://github.com/lekemula/solargraph-rspec/pull/30
git clone https://github.com/apiology/solargraph-rspec.git
cd solargraph-rspec
git checkout reset_closures
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
Expand Down Expand Up @@ -153,10 +150,12 @@ jobs:
run: |
cd ../solargraph-rspec
cp .solargraph.yml.example .solargraph.yml
- name: Solargraph generate RSpec gems YARD and RBS pins
- name: Solargraph generate RSpec gems YARD pins
run: |
cd ../solargraph-rspec
bundle exec appraisal rbs collection update
# solargraph-rspec's specs don't pass a workspace, so it
# doesn't know where to look for the RBS collection - let's
# not load one so that the solargraph gems command below works
rspec_gems=$(bundle exec appraisal ruby -r './lib/solargraph-rspec' -e 'puts Solargraph::Rspec::Gems.gem_names.join(" ")' 2>/dev/null | tail -n1)
bundle exec appraisal solargraph gems $rspec_gems
- name: Run specs
Expand Down
58 changes: 46 additions & 12 deletions .github/workflows/rspec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,50 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
ruby-version: ['3.0', '3.1', '3.2', '3.3', '3.4', '4.0']
rbs-version: ['3.6.1', '3.9.5', '4.0.0.dev.4']
ruby-version: ['3.0', '3.1', '3.2', '3.3', '3.4', '4.0', 'head']
rbs-version: ['3.6.1', '3.8.1', '3.9.5', '3.10.0', '4.0.0.dev.4']
# Ruby 3.0 doesn't work with RBS 3.9.4 or 4.0.0.dev.4
exclude:
# only include the 3.0 variants we include later
- ruby-version: '3.0'
rbs-version: '3.9.5'
- ruby-version: '3.0'
rbs-version: '4.0.0.dev.4'
# Missing require in 'rbs collection update' - hopefully
# fixed in next RBS release
# only include the 3.1 variants we include later
- ruby-version: '3.1'
# only include the 3.2 variants we include later
- ruby-version: '3.2'
# only include the 3.3 variants we include later
- ruby-version: '3.3'
# only include the 3.4 variants we include later
- ruby-version: '3.4'
# only include the 4.0 variants we include later
- ruby-version: '4.0'
# Don't exclude 'head' - let's test all RBS versions we
# can there.
#
#
# Just exclude some odd-ball compatibility issues we can't
# work around:
#
# https://github.com/castwide/solargraph/actions/runs/20627923548/job/59241444380?pr=1102
- ruby-version: 'head'
rbs-version: '3.6.1'
- ruby-version: '4.0'
- ruby-version: 'head'
rbs-version: '3.8.1'
- ruby-version: 'head'
rbs-version: '4.0.0.dev.4'
include:
- ruby-version: '3.0'
rbs-version: '3.6.1'
- ruby-version: '3.1'
rbs-version: '3.6.1'
- ruby-version: '3.2'
rbs-version: '3.8.1'
- ruby-version: '3.3'
rbs-version: '3.9.5'
- ruby-version: '3.3'
rbs-version: '3.10.0'
- ruby-version: '3.4'
rbs-version: '3.10.0'
- ruby-version: '3.4'
rbs-version: '4.0.0.dev.4'
steps:
- uses: actions/checkout@v3
Expand All @@ -58,11 +89,8 @@ jobs:
run: |
bundle _2.5.23_ install
bundle update rbs # use latest available for this Ruby version
bundle list
bundle exec solargraph pin 'Bundler::Dsl#source'
- name: Update types
run: |
bundle exec rbs collection update
run: bundle exec rbs collection update
- name: Run tests
run: bundle exec rake spec
undercover:
Expand All @@ -77,9 +105,15 @@ jobs:
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.4'
# see https://github.com/castwide/solargraph/actions/runs/19391419903/job/55485410493?pr=1119
#
# match version in Gemfile.lock and use same version below
bundler: 2.5.23
bundler-cache: false
- name: Install gems
run: bundle install
- name: Update types
run: bundle exec rbs collection update
- name: Run tests
run: bundle exec rake spec
- name: Check PR coverage
Expand Down
11 changes: 0 additions & 11 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ Layout/ElseAlignment:
# Configuration parameters: EmptyLineBetweenMethodDefs, EmptyLineBetweenClassDefs, EmptyLineBetweenModuleDefs, DefLikeMacros, AllowAdjacentOneLineDefs, NumberOfEmptyLines.
Layout/EmptyLineBetweenDefs:
Exclude:
- 'lib/solargraph/doc_map.rb'
- 'lib/solargraph/language_server/message/initialize.rb'
- 'lib/solargraph/pin/delegated_method.rb'

Expand Down Expand Up @@ -200,7 +199,6 @@ Layout/MultilineMethodCallIndentation:
# SupportedStyles: aligned, indented
Layout/MultilineOperationIndentation:
Exclude:
- 'lib/solargraph/api_map.rb'
- 'lib/solargraph/language_server/host/dispatch.rb'
- 'lib/solargraph/source.rb'

Expand Down Expand Up @@ -431,12 +429,6 @@ Lint/UnusedBlockArgument:
Lint/UnusedMethodArgument:
Enabled: false

# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: ContextCreatingMethods, MethodCreatingMethods.
Lint/UselessAccessModifier:
Exclude:
- 'lib/solargraph/api_map.rb'

# This cop supports safe autocorrection (--autocorrect).
Lint/UselessAssignment:
Enabled: false
Expand Down Expand Up @@ -553,7 +545,6 @@ Naming/VariableName:
RSpec/Be:
Exclude:
- 'spec/rbs_map/stdlib_map_spec.rb'
- 'spec/rbs_map_spec.rb'
- 'spec/source/source_chainer_spec.rb'

# This cop supports unsafe autocorrection (--autocorrect-all).
Expand All @@ -576,7 +567,6 @@ RSpec/BeforeAfterAll:
- '**/spec/rails_helper.rb'
- '**/spec/support/**/*.rb'
- 'spec/api_map_spec.rb'
- 'spec/doc_map_spec.rb'
- 'spec/language_server/host/dispatch_spec.rb'
- 'spec/language_server/protocol_spec.rb'

Expand Down Expand Up @@ -1112,7 +1102,6 @@ Style/RedundantRegexpEscape:
Style/RedundantReturn:
Exclude:
- 'lib/solargraph/complex_type/type_methods.rb'
- 'lib/solargraph/doc_map.rb'
- 'lib/solargraph/parser/parser_gem/node_methods.rb'
- 'lib/solargraph/source/chain/z_super.rb'

Expand Down
80 changes: 39 additions & 41 deletions lib/solargraph/api_map.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ def initialize pins: []
index pins
end

# @param out [StringIO, IO, nil] output stream for logging
# @return [void]
def self.reset_core out: nil
@@core_map = RbsMap::CoreMap.new
end

#
# This is a mutable object, which is cached in the Chain class -
# if you add any fields which change the results of calls (not
Expand All @@ -48,6 +54,7 @@ def ==(other)
self.eql?(other)
end

# @return [Integer]
def hash
equality_fields.hash
end
Expand Down Expand Up @@ -98,11 +105,11 @@ def catalog bench
end
unresolved_requires = (bench.external_requires + conventions_environ.requires + bench.workspace.config.required).to_a.compact.uniq
recreate_docmap = @unresolved_requires != unresolved_requires ||
@doc_map&.uncached_yard_gemspecs&.any? ||
@doc_map&.uncached_rbs_collection_gemspecs&.any? ||
@doc_map&.rbs_collection_path != bench.workspace.rbs_collection_path
workspace.rbs_collection_path != bench.workspace.rbs_collection_path ||
@doc_map.any_uncached?

if recreate_docmap
@doc_map = DocMap.new(unresolved_requires, [], bench.workspace) # @todo Implement gem preferences
@doc_map = DocMap.new(unresolved_requires, [], bench.workspace, out: nil) # @todo Implement gem preferences
@unresolved_requires = @doc_map.unresolved_requires
end
@cache.clear if store.update(@@core_map.pins, @doc_map.pins, conventions_environ.pins, iced_pins, live_pins)
Expand All @@ -119,30 +126,20 @@ def catalog bench

# @return [DocMap]
def doc_map
@doc_map ||= DocMap.new([], [])
@doc_map ||= DocMap.new([], [], Workspace.new('.'))
end

# @return [::Array<Gem::Specification>]
def uncached_gemspecs
@doc_map&.uncached_gemspecs || []
end

# @return [::Array<Gem::Specification>]
def uncached_rbs_collection_gemspecs
@doc_map.uncached_rbs_collection_gemspecs
end

# @return [::Array<Gem::Specification>]
def uncached_yard_gemspecs
@doc_map.uncached_yard_gemspecs
end

# @return [Enumerable<Pin::Base>]
def core_pins
@@core_map.pins
end

# @param name [String]
# @param name [String, nil]
# @return [YARD::Tags::MacroDirective, nil]
def named_macro name
store.named_macros[name]
Expand Down Expand Up @@ -192,18 +189,10 @@ def self.load directory
api_map
end

# @param out [IO, nil]
# @param out [StringIO, IO, nil]
# @return [void]
def cache_all!(out)
@doc_map.cache_all!(out)
end

# @param gemspec [Gem::Specification]
# @param rebuild [Boolean]
# @param out [IO, nil]
# @return [void]
def cache_gem(gemspec, rebuild: false, out: nil)
@doc_map.cache(gemspec, rebuild: rebuild, out: out)
def cache_all_for_doc_map! out
doc_map.cache_doc_map_gems!(out)
end

class << self
Expand All @@ -215,17 +204,17 @@ class << self
#
#
# @param directory [String]
# @param out [IO] The output stream for messages
# @param out [IO, StringIO, nil] The output stream for messages
#
# @return [ApiMap]
def self.load_with_cache directory, out
def self.load_with_cache directory, out = $stderr
api_map = load(directory)
if api_map.uncached_gemspecs.empty?
logger.info { "All gems cached for #{directory}" }
return api_map
end

api_map.cache_all!(out)
api_map.cache_all_for_doc_map!(out)
load(directory)
end

Expand Down Expand Up @@ -328,7 +317,7 @@ def get_includes(fqns)
# @param namespace [String] A fully qualified namespace
# @param scope [Symbol] :instance or :class
# @return [Array<Solargraph::Pin::InstanceVariable>]
def get_instance_variable_pins(namespace, scope = :instance)
def get_instance_variable_pins namespace, scope = :instance
result = []
used = [namespace]
result.concat store.get_instance_variables(namespace, scope)
Expand All @@ -340,8 +329,10 @@ def get_instance_variable_pins(namespace, scope = :instance)
result
end

# @sg-ignore Missing @return tag for Solargraph::ApiMap#visible_pins
# @see Solargraph::Parser::FlowSensitiveTyping#visible_pins
# @param (see Solargraph::Parser::FlowSensitiveTyping#visible_pins)
# @sg-ignore Missing @return tag for Solargraph::ApiMap#visible_pins
# @return (see Solargraph::Parser::FlowSensitiveTyping#visible_pins)
def visible_pins(*args, **kwargs, &blk)
Solargraph::Parser::FlowSensitiveTyping.visible_pins(*args, **kwargs, &blk)
end
Expand All @@ -350,7 +341,7 @@ def visible_pins(*args, **kwargs, &blk)
#
# @param namespace [String] A fully qualified namespace
# @return [Enumerable<Solargraph::Pin::ClassVariable>]
def get_class_variable_pins(namespace)
def get_class_variable_pins namespace
prefer_non_nil_variables(store.get_class_variables(namespace))
end

Expand Down Expand Up @@ -672,10 +663,17 @@ def resolve_method_aliases pins, visibility = [:public, :private, :protected]
next nil if resolved.respond_to?(:visibility) && !visibility.include?(resolved.visibility)
resolved
end.compact
logger.debug { "ApiMap#resolve_method_aliases(pins=#{pins.map(&:name)}, visibility=#{visibility}) => #{with_resolved_aliases.map(&:name)}" }
logger.debug do
"ApiMap#resolve_method_aliases(pins=#{pins.map(&:name)}, visibility=#{visibility}) => #{with_resolved_aliases.map(&:name)}"
end
GemPins.combine_method_pins_by_path(with_resolved_aliases)
end

# @return [Workspace, nil]
def workspace
doc_map.workspace
end

# @param fq_reference_tag [String] A fully qualified whose method should be pulled in
# @param namespace_pin [Pin::Base] Namespace pin for the rooted_type
# parameter - used to pull generics information
Expand Down Expand Up @@ -773,7 +771,8 @@ def inner_get_methods rooted_tag, scope, visibility, deep, skip, no_core = false
end
rooted_sc_tag = qualify_superclass(rooted_tag)
unless rooted_sc_tag.nil?
result.concat inner_get_methods_from_reference(rooted_sc_tag, namespace_pin, rooted_type, scope, visibility, true, skip, no_core)
result.concat inner_get_methods_from_reference(rooted_sc_tag, namespace_pin, rooted_type, scope,
visibility, true, skip, no_core)
end
else
logger.info { "ApiMap#inner_get_methods(#{fqns}, #{scope}, #{visibility}, #{deep}, #{skip}) - looking for get_extends() from #{fqns}" }
Expand All @@ -783,7 +782,8 @@ def inner_get_methods rooted_tag, scope, visibility, deep, skip, no_core = false
end
rooted_sc_tag = qualify_superclass(rooted_tag)
unless rooted_sc_tag.nil?
result.concat inner_get_methods_from_reference(rooted_sc_tag, namespace_pin, rooted_type, scope, visibility, true, skip, true)
result.concat inner_get_methods_from_reference(rooted_sc_tag, namespace_pin, rooted_type, scope,
visibility, true, skip, true)
end
unless no_core || fqns.empty?
type = get_namespace_type(fqns)
Expand Down Expand Up @@ -841,8 +841,6 @@ def prefer_non_nil_variables pins

include Logging

private

# @param alias_pin [Pin::MethodAlias]
# @return [Pin::Method, nil]
def resolve_method_alias(alias_pin)
Expand Down Expand Up @@ -916,7 +914,7 @@ def create_resolved_alias_pin(alias_pin, original)
# @param rooted_type [ComplexType]
# @param pins [Enumerable<Pin::Base>]
# @return [Array<Pin::Base>]
def erase_generics(namespace_pin, rooted_type, pins)
def erase_generics namespace_pin, rooted_type, pins
return pins unless should_erase_generics_when_done?(namespace_pin, rooted_type)

logger.debug("Erasing generics on namespace_pin=#{namespace_pin} / rooted_type=#{rooted_type}")
Expand All @@ -927,7 +925,7 @@ def erase_generics(namespace_pin, rooted_type, pins)

# @param namespace_pin [Pin::Namespace]
# @param rooted_type [ComplexType]
def should_erase_generics_when_done?(namespace_pin, rooted_type)
def should_erase_generics_when_done? namespace_pin, rooted_type
has_generics?(namespace_pin) && !can_resolve_generics?(namespace_pin, rooted_type)
end

Expand All @@ -938,7 +936,7 @@ def has_generics?(namespace_pin)

# @param namespace_pin [Pin::Namespace]
# @param rooted_type [ComplexType]
def can_resolve_generics?(namespace_pin, rooted_type)
def can_resolve_generics? namespace_pin, rooted_type
has_generics?(namespace_pin) && !rooted_type.all_params.empty?
end
end
Expand Down
Loading
Loading