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
8 changes: 8 additions & 0 deletions lib/rbs/ast/ruby/declarations.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ def type_params = []
def location
rbs_location(node.location)
end

def name_location
rbs_location(node.constant_path.location)
end
end

class ModuleDecl < Base
Expand Down Expand Up @@ -79,6 +83,10 @@ def self_types = []
def location
rbs_location(node.location)
end

def name_location
rbs_location(node.constant_path.location)
end
end
end
end
Expand Down
4 changes: 4 additions & 0 deletions lib/rbs/ast/ruby/members.rb
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,10 @@ def overloading?
def annotations
[]
end

def name_location
rbs_location(node.name_loc)
end
end
end
end
Expand Down
4 changes: 4 additions & 0 deletions sig/ast/ruby/declarations.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ module RBS
def type_params: () -> Array[AST::TypeParam]

def location: () -> Location

def name_location: () -> Location
end

class ModuleDecl < Base
Expand All @@ -53,6 +55,8 @@ module RBS
def location: () -> Location

def self_types: () -> Array[AST::Declarations::Module::Self]

def name_location: () -> Location
end
end
end
Expand Down
2 changes: 2 additions & 0 deletions sig/ast/ruby/members.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ module RBS
def overloading?: () -> bool

def annotations: () -> Array[AST::Annotation]

def name_location: () -> Location
end
end
end
Expand Down