File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -29,10 +29,15 @@ def self.load_rbs_builder
2929 sig_path = Pathname ( 'sig' )
3030 loader . add path : sig_path
3131 expanded_sig_path = sig_path . expand_path . to_s
32- Gem . loaded_specs . values . each do |spec |
33- gem_sig_path = File . expand_path ( "#{ spec . gem_dir } /sig" )
34- loader . add ( library : spec . name , version : spec . version ) if Dir . exist? ( gem_sig_path ) && expanded_sig_path != gem_sig_path
32+
33+ unless File . exist? ( 'rbs_collection.yaml' )
34+ # Load rbs signature from gems. This is a fallback when rbs_collection.yaml is not available.
35+ Gem . loaded_specs . values . each do |spec |
36+ gem_sig_path = File . expand_path ( "#{ spec . gem_dir } /sig" )
37+ loader . add ( library : spec . name , version : spec . version ) if Dir . exist? ( gem_sig_path ) && expanded_sig_path != gem_sig_path
38+ end
3539 end
40+
3641 env = RBS ::Environment . from_loader ( loader )
3742 # [Hack] Monkey patch for improving development experience
3843 def env . resolve_declaration ( *, **)
You can’t perform that action at this time.
0 commit comments