Fix crash when requesting signature help at the top level.

This commit is contained in:
Michele Campeotto 2025-03-22 12:05:07 +01:00 committed by Phil Hagelberg
parent e504013663
commit 9dfe25b8cb

View File

@ -278,8 +278,9 @@ find the definition `10`, but if `opts.stop-early?` is set, it would find
"Find the nearest call "Find the nearest call
returns the called symbol and the argument number position points to" returns the called symbol and the argument number position points to"
(let [(_ [[call] [parent]]) (find-symbol file.ast byte)] (let [(_ [[call] parent-call]) (find-symbol file.ast byte)
(if (special? parent) parent (?. parent-call 1)]
(if (and parent (special? parent))
(values parent -1) (values parent -1)
(values call -1)))) (values call -1))))