Skip to content

Commit

Permalink
Fix comments parsing for RBI::Method
Browse files Browse the repository at this point in the history
Signed-off-by: Alexandre Terrasa <[email protected]>
  • Loading branch information
Morriar committed Jul 31, 2024
1 parent ec9da9e commit 86a9dd8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/rbi/parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -242,10 +242,10 @@ def visit_def_node(node)
@last_node = node
current_scope << Method.new(
node.name.to_s,
comments: current_sigs_comments + node_comments(node),
params: parse_params(node.parameters),
sigs: current_sigs,
loc: node_loc(node),
comments: current_sigs_comments + node_comments(node),
is_singleton: !!node.receiver,
)
@last_node = nil
Expand Down
2 changes: 1 addition & 1 deletion test/rbi/parser_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -720,7 +720,7 @@ module A
# B comment
class B
# c comment
def c; end
def c(a); end
# d comment
attr_reader :a
Expand Down

0 comments on commit 86a9dd8

Please sign in to comment.