Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 4 additions & 0 deletions lib/rbs/environment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ class Environment

attr_reader :sources

def declarations
sources.flat_map(&:declarations)
end

class SingleEntry
attr_reader :name
attr_reader :context
Expand Down
3 changes: 3 additions & 0 deletions sig/environment.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ module RBS
class GlobalEntry < SingleEntry[Symbol, AST::Declarations::Global]
end

# Top level declarations
def declarations: () -> Array[AST::Ruby::Declarations::t | AST::Declarations::t]

# Array of source objects loaded in the environment
#
attr_reader sources: Array[Source::t]
Expand Down