Skip to content

"Go to definition" does not work with macros #767

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Sleepful opened this issue Nov 10, 2022 · 5 comments
Closed

"Go to definition" does not work with macros #767

Sleepful opened this issue Nov 10, 2022 · 5 comments
Labels
duplicate This issue or pull request already exists

Comments

@Sleepful
Copy link

Environment

  • Elixir & Erlang versions (elixir --version):
    Erlang/OTP 25 [erts-13.0.3] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [jit]
    Elixir 1.14.1 (compiled with Erlang/OTP 25)

  • Elixir Language Server version: elixir-ls-14

  • Operating system: OSX

  • Editor or IDE name (e.g. Emacs/VSCode): emacs

  • Editor Plugin/LSP Client name and version: LSP

Current behavior

lsp-find-definition does not work on macros

Expected behavior

lsp-find-definition should work on macros

@lukaszsamson
Copy link
Collaborator

Please post a project that reproduces it

@robsonpeixoto
Copy link
Contributor

robsonpeixoto commented Nov 25, 2022

https://github.com/robsonpeixoto/elixir-ls-go-to-definition-bug

Open the file https://github.com/robsonpeixoto/elixir-ls-go-to-definition-bug/blob/main/lib/bug.ex and try to go-to-defition of ModA.say_hi function.

I'm using VSCode:

Version: 1.73.1
Commit: 6261075646f055b99068d3688932416f2346dd3b
Date: 2022-11-09T02:08:38.961Z
Electron: 19.0.17
Chromium: 102.0.5005.167
Node.js: 16.14.2
V8: 10.2.154.15-electron.0
OS: Darwin x64 22.1.0
Sandboxed: No

[email protected]

@lukaszsamson
Copy link
Collaborator

I cannot reproduce it when building elixir-ls locally

Screenshot 2022-11-26 at 14 35 27

``` [Info - 2:33:44 PM] Started ElixirLS v0.12.0 [Info - 2:33:44 PM] ElixirLS built with elixir "1.14.2" on OTP "25" [Info - 2:33:44 PM] Running on elixir "1.14.2 (compiled with Erlang/OTP 25)" on OTP "25" ```

but I can when I run it in installed plugin

[Info  - 2:36:55 PM] Started ElixirLS v0.12.0
[Info  - 2:36:55 PM] ElixirLS built with elixir "1.11.4" on OTP "22"
[Info  - 2:36:55 PM] Running on elixir "1.14.2 (compiled with Erlang/OTP 25)" on OTP "25"

It's a duplicate of #193

@lukaszsamson lukaszsamson added the duplicate This issue or pull request already exists label Nov 26, 2022
@Sleepful
Copy link
Author

@lukaszsamson the linked issue mentions that the problem comes from building elixir-ls with an elixir version different from system version. But I have the elixir-ls-1.14-25.1 and Elixir 1.14.1, are these not the same version?

I downloaded directly from the Relase page here in github, not the VSCode marketplace or whatever.

oh but when I look into the version of the LSP: ElixirLS compiled with Elixir 1.11.4

so why is elixir-ls-1.14-25.1 compiled with Elixir 1.11.4?

@Sleepful
Copy link
Author

Sleepful commented Dec 10, 2022

So apparently there was a lingering ElixirLS version (installed by lsp-mode in emacs) that was taking precedence over the latest one (that I installed by following the README instructions and adding 'exec-path). I ended up building from source. Also came across this issue, and this comment solved it: #783 (comment)

Can confirm I can follow macros now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

3 participants