Skip to content

Commit 800a1d5

Browse files
author
Aryan Soni
committed
Ensure call nodes for callbacks are only processed for instantiations
1 parent 734259e commit 800a1d5

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/ruby_lsp/ruby_lsp_rails/document_symbol.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,8 @@ def extract_callbacks(node)
148148
selection_range: range_from_location(argument.location),
149149
)
150150
when Prism::CallNode
151+
next unless argument.name == :new
152+
151153
arg_receiver = argument.receiver
152154

153155
name = arg_receiver.name if arg_receiver.is_a?(Prism::ConstantReadNode)

0 commit comments

Comments
 (0)