elixir_sense icon indicating copy to clipboard operation
elixir_sense copied to clipboard

Get Behaviour callback defined spec when showing type def of the implementation

Open rlopzc opened this issue 4 years ago • 0 comments

Environment

  • Elixir & Erlang versions (elixir --version): Erlang/OTP 24 - Elixir 1.12.2
  • Operating system: ArchLinux
  • Editor or IDE name (e.g. Emacs/VSCode): NVim
  • Editor Plugin/LSP Client name: nvim-lspconfig

Troubleshooting

  • [x] Restart your editor (which will restart ElixirLS) sometimes fixes issues
  • [x] Stop your editor, remove the entire .elixir_ls directory, then restart your editor
    • NOTE: This will cause you to have to re-run the dialyzer build for your project

When I hover over a function implementation of a callback, it shows me term typespec instead of the defined callback typespec. ie.

defmodule MyBehaviour do
  @callback print(name :: binary()) :: :ok
end

defmodule MyPrinter do
  @behaviour MyBehaviour

  @impl true
  def print(name), do: :ok
end

Hovering to MyPrinter.print displays MyPrinter.print(term) and it should be MyPrinter.print(binary) :: :ok

How can I see the correct function typespec?

rlopzc avatar Sep 03 '21 22:09 rlopzc