vscode-elixir-ls
vscode-elixir-ls copied to clipboard
Multi-root workspace with independent mix projects when the root folder is also a mix project
The issue is related to #313 , but a bit different.
Before I was using the extension with multi-root workspaces where each root was containing an Elixir app.
But now I'm trying to adapt Workspace to organize monorepo project, and the vscode workspace root got its own mix.exs. I can set projectRoot, but then I can have only one active Elixir project, and I need to have many.
In my case the structure looks like this:
/ (repo and vscode workspace root)
┣ .workspace (contains some config for tools, has nothing to do with Elixir)
┣ apps/
┃ ┗ app-a/
┃ ┃ ┗ mix.exs
┃ ┗ app-b/
┃ ┗ mix.exs
┣ packages
┃ ┗ packages-a/
┃ ┃ ┗ mix.exs
┃ ┗ packages-a/
┃ ┃ ┗ mix.exs
┃ ┗ packages-c/
┃ ┗ mix.exs
┣ .formatter.exs
┣ .gitignore.exs
┣ .workspace.exs
┣ mix.exs
┗ project.code-workspace
I need to have apps/app-X, packages/package-X et al. as separate workspace root folders, but I also need the main root as well as I need to work within it and be able to run mix tasks.
I believe it worth to introduce a setting useCurrentRootFolderAsProjectDir with false as default to restrict looking for the mix.exs in the current directory only. It would keep backward compatibility, at the same time allowing to have such configuration.
The PR is following.