File tree Expand file tree Collapse file tree 1 file changed +3
-14
lines changed
Expand file tree Collapse file tree 1 file changed +3
-14
lines changed Original file line number Diff line number Diff line change @@ -184,24 +184,13 @@ module Prism
184184 queue = [self] #: Array[Prism::node]
185185 result = [] #: Array[Prism::node]
186186
187+ search_offset = source.offsets[line - 1] + column
188+
187189 while (node = queue.shift)
188190 result < < node
189191
190192 node.compact_child_nodes.each do |child_node|
191- child_location = child_node.location
192-
193- start_line = child_location.start_line
194- end_line = child_location.end_line
195-
196- if start_line == end_line
197- if line == start_line && column > = child_location.start_column && column < child _location.end_column
198- queue < < child _node
199- break
200- end
201- elsif (line == start_line && column > = child_location.start_column) || (line == end_line && column < child _location.end_column)
202- queue < < child _node
203- break
204- elsif line > start_line && line < end _line
193+ if child_node.start_offset < = search_offset && search_offset < child _node.end_offset
205194 queue < < child _node
206195 break
207196 end
You can’t perform that action at this time.
0 commit comments