Skip to content
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

Inconsistency in go-to definition/references for modules based on syntax #1027

Closed
jaminthorns opened this issue Nov 17, 2023 · 2 comments
Closed
Labels
duplicate This issue or pull request already exists

Comments

@jaminthorns
Copy link
Contributor

Environment

  • Elixir & Erlang versions (elixir --version):
    • Erlang/OTP 26 [erts-14.1.1] [source] [64-bit] [smp:10:10] [ds:10:10:10] [async-threads:1] [jit]
    • Elixir 1.15.7 (compiled with Erlang/OTP 24)
  • VSCode ElixirLS version: 0.17.9
  • Operating System Version: darwin 23.1.0

Current behavior

When doing go-to definition/references for modules, I get inconsistent behavior based on the syntax the module is being used in and whether my cursor is on the last character of the module name.

Here's a video demonstrating the inconsistencies:

compressed.mp4

And here's the code used in the video:

defmodule Test do
  def test, do: nil
end

defmodule OtherModule do
  def test do
    # Module name (all characters working)
    Test

    # Remote call (last character references function instead of module)
    Test.test()

    # Remote capture (last character references function instead of module)
    _ = &Test.test/0

    # Module name in list
    [
      # Comma after (last character not working)
      Test,
      # Space after (all characters working)
      Test ,
      # Nothing after (all characters working)
      Test
    ]

    # Module name in arguments (last character not working)
    List.wrap(Test)
  end
end

It's worth noting that this is different from #1038. I'm using Elixir 1.15, and function go-to/references are working properly when the cursor is at the end of the symbol.

Expected behavior

I expect the behavior of go-to definition/references to be the same regardless of where the cursor is positioned in all of the examples shown.

@lukaszsamson
Copy link
Collaborator

It seems the upstream elixir fix did not resolve the issue in all cases. It is the same problem

@lukaszsamson
Copy link
Collaborator

I reopened the original issue

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

2 participants