From ffc75b5b3e929afecb3c12eee2443ff62f50f060 Mon Sep 17 00:00:00 2001 From: Vince Broz Date: Tue, 8 Apr 2025 12:13:38 -0400 Subject: [PATCH 1/3] Restore RBS::Environment#declarations for backwards-compatibility --- lib/rbs/environment.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/rbs/environment.rb b/lib/rbs/environment.rb index e013c3529..605844fd3 100644 --- a/lib/rbs/environment.rb +++ b/lib/rbs/environment.rb @@ -11,6 +11,10 @@ class Environment attr_reader :sources + def declarations + sources.flat_map(&:declarations) + end + class SingleEntry attr_reader :name attr_reader :context From d73093bf85577a0510b24897a64ff8c77f245119 Mon Sep 17 00:00:00 2001 From: Vince Broz Date: Tue, 8 Apr 2025 12:31:00 -0400 Subject: [PATCH 2/3] Restore RBS::Environment#declarations for backwards-compatibility --- sig/environment.rbs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sig/environment.rbs b/sig/environment.rbs index 0d7e783aa..172be1d9d 100644 --- a/sig/environment.rbs +++ b/sig/environment.rbs @@ -30,6 +30,9 @@ module RBS class GlobalEntry < SingleEntry[Symbol, AST::Declarations::Global] end + # Top level declarations + attr_reader declarations: Array[AST::Declarations::t] + # Array of source objects loaded in the environment # attr_reader sources: Array[Source::t] From 59cc17177b62868660be1b3a01108701e872df05 Mon Sep 17 00:00:00 2001 From: Vince Broz Date: Tue, 8 Apr 2025 12:57:41 -0400 Subject: [PATCH 3/3] Restore RBS::Environment#declarations for backwards-compatibility --- sig/environment.rbs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sig/environment.rbs b/sig/environment.rbs index 172be1d9d..aaa4d447e 100644 --- a/sig/environment.rbs +++ b/sig/environment.rbs @@ -31,7 +31,7 @@ module RBS end # Top level declarations - attr_reader declarations: Array[AST::Declarations::t] + def declarations: () -> Array[AST::Ruby::Declarations::t | AST::Declarations::t] # Array of source objects loaded in the environment #