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.46k stars 194 forks source link

ElixirLS cannot find root mix.exs in Emacs from subdirectory. #645

Closed KaranAhlawat closed 2 years ago

KaranAhlawat commented 2 years ago

Environment

I have a directory named Elixir, in which each subdir is a mix project, made using mix new. image

When I open a project, if the file I open is in the root of the project, living besides the mix.exs file, then the language support works as expected. But if I open a file from a subdirectory of the project, it says that it cannot find the project mix.exs file, and that I may set it manually using elixirLS.projectDir.

I looked at the eglot event logs and the language server only searches the current file's directory for a mix file for some reason.

Any help is appreciated, and I am ready to provide any logs or such that I may provide assistantance.

axelson commented 2 years ago

I haven't used eglot before, but lsp-mode lets you set the root directory of your project. Does eglot have a similar setting?

KaranAhlawat commented 2 years ago

From looking at their repository, I don't think that they have a similar setting. Since their idea is as little user configuration needed as possible.

KaranAhlawat commented 2 years ago

Update : Using project.el instead of projectile for projects seems to have fixed the issue. The language server is recognising the project root correctly.

I will let it run for a day or so, and if it continues to work as expected, will mark the issue as closed.

KaranAhlawat commented 2 years ago

Marking this issue as closed, seems like it was a projectile thing.