lexical-lsp / lexical

Lexical is a next-generation elixir language server
776 stars 77 forks source link

Fix go to definition behavior for same-name, same-arity functions by directing to the first function #746

Closed scottming closed 1 month ago

scottming commented 1 month ago

After this PR #744 was merged, I spent a whole day using the latest features. In the case of delegates, returning multiple definitions is undoubtedly useful, but in another scenario, such as when there are when clauses, returning multiple definitions is undoubtedly a distraction (in Neovim, I need to press the keys twice more and think about it). Therefore, the solution in this PR is to directly jump to the position of the first function for such cases where there are same-name, same-arity functions in the same file.