Skip to content

Neovim elixirls autocompetion source failed for local module #995

@huibosa

Description

@huibosa

Environment

  • Elixir & Erlang versions (elixir --version): Erlang/OTP 26 [erts-14.0.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [jit] [dtrace] Elixir 1.15.6 (compiled with Erlang/OTP 26)
  • Elixir Language Server version: v0.16.0
  • Operating system: macos
  • Editor or IDE name (e.g. Emacs/VSCode): Neovim
  • Editor Plugin/LSP Client name and version: lspconfig

Current behavior

A short description of the issue

Begin learning elixir recently, and I was setup the elixirls in neovim following this guide. I could get most of the lsp elixirls feature work, such as doc hover, snippet, autocompletion, and so on, but I found I just can’t get the autocompeletion work for local module in another file. I’ll describe my problem as follows:

I've got two files in same directory, person.exs and main.exs:

Screenshot 2023-10-03 at 4 14 18 PM Screenshot 2023-10-03 at 4 15 35 PM

which can be seen from the pictures that the autocompeletion source for module Person failed in main.exs. However, when I move the statements to person.exs, I could get the expected autocompeletion:

Screenshot 2023-10-03 at 4 16 36 PM

At first I thought this would be a lack of implementation of something in elixirls, but when I switch to vscode, where I've installed the elixirls viscode extension, finding that the autocompeletion works as ecpected:

Screenshot 2023-10-03 at 3 59 40 PM

ElixirLS logs

[START][2023-10-03 17:51:28] LSP logging initiated
[ERROR][2023-10-03 17:51:28] .../vim/lsp/rpc.lua:734	"rpc"	"/Users/huibosa/.local/share/nvim/mason/packages/elixir-ls/language_server.sh"	"stderr"	"Running /Users/huibosa/.local/share/nvim/mason/packages/elixir-ls/launch.sh\nPreffered shell is zsh, relaunching\nLooking for ASDF install\nASDF not found\nLooking for rtx executable\nrtx not found\n"
[ERROR][2023-10-03 17:51:28] .../vim/lsp/rpc.lua:734	"rpc"	"/Users/huibosa/.local/share/nvim/mason/packages/elixir-ls/language_server.sh"	"stderr"	"Installing ElixirLS release v0.16.0\n"
[ERROR][2023-10-03 17:51:28] .../vim/lsp/rpc.lua:734	"rpc"	"/Users/huibosa/.local/share/nvim/mason/packages/elixir-ls/language_server.sh"	"stderr"	"Running in /Users/huibosa\n"
[ERROR][2023-10-03 17:51:29] .../vim/lsp/rpc.lua:734	"rpc"	"/Users/huibosa/.local/share/nvim/mason/packages/elixir-ls/language_server.sh"	"stderr"	"Install complete\n"
[ERROR][2023-10-03 17:51:29] ...lsp/handlers.lua:535	"Cannot get client configuration: {:ok, [nil]}"
[WARN][2023-10-03 17:51:32] ...lsp/handlers.lua:537	"Did not receive workspace/didChangeConfiguration notification after 3 seconds. The server will use default config."
[WARN][2023-10-03 17:51:32] ...lsp/handlers.lua:537	'No mixfile found in project. To use a subdirectory, set `elixirLS.projectDir` in your settings. Looked for mixfile at "/Users/huibosa/mix.exs"'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions