elixir-lsp / elixir-ls

A frontend-independent IDE "smartness" server for Elixir. Implements the "Language Server Protocol" standard and provides debugger support via the "Debug Adapter Protocol"
https://elixir-lsp.github.io/elixir-ls/
Apache License 2.0
1.5k stars 196 forks source link

Go to definition does not work with backticks #1061

Open xxdavid opened 9 months ago

xxdavid commented 9 months ago

Environment

Elixir 1.14.3 (compiled with Erlang/OTP 25)

and

Erlang/OTP 26 [erts-14.2.1] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:1] [jit:ns]

Elixir 1.15.7 (compiled with Erlang/OTP 26)

(tested on both)
* Elixir Language Server version: 0.19.0
* Operating system: macOS 11.7
* Editor or IDE name (e.g. Emacs/VSCode): VS Code
* Editor Plugin/LSP Client name and version: ElixirLS 0.19.0

### Current behavior

Suppose we have a file like this
```elixir
1 defmodule SomeModule do
2   @doc """
3   Some function.
4 
5   See MyModule.my_fun/1
6   See `MyModule.my_fun/1`
7   """
8   def some_fun, do: 42
9 end

If I use go to definition on my_fun on line 5, it jumps to the definition of MyModule.my_fun/1. If I do the same with my_fun on line 6, it does not do anything. The same happens on MyModule and it's also the same with hover. If I remove the first backtick on line 6, it works. If I remove (only) the second backtick on line 6, it does not work.

Expected behavior

I would expect that go to definition and hover would work on line 6 (and also on line 5).