mirror of
https://github.com/dense-analysis/ale.git
synced 2025-12-07 13:14:29 +08:00
elixir-ls now recognizes umbrella projects
Previously, elixir-ls would treat each sub-project within an umbrella as standalone, which isn't desirable from a language server perspective. Added ale#handlers#elixir#FindMixUmbrellaRoot, which locates the current project's root and then continues searching upwards for a potential umbrella project root. This literally looks just two levels up to keep things simple while keeping in line with Elixir project conventions. Use this new function to determine elixir-ls's LSP project root.
This commit is contained in:
@@ -18,9 +18,16 @@ Execute(The default mix command should be correct):
|
||||
\ . g:env_prefix
|
||||
\ . 'mix compile %s'
|
||||
|
||||
Execute(The FindMixProjectRoot should detect the project root directory via mix.exs):
|
||||
silent execute 'file ' . fnameescape(g:dir . '/elixir_paths/mix_project/lib/app.ex')
|
||||
Execute(FindMixProjectRoot should detect the project root directory via mix.exs):
|
||||
silent execute 'file ' . fnameescape(g:dir . '/elixir_paths/mix_project/lib/app.ex')
|
||||
|
||||
AssertEqual
|
||||
\ ale#path#Simplify(g:dir . '/elixir_paths/mix_project'),
|
||||
AssertEqual
|
||||
\ ale#path#Simplify(g:dir . '/elixir_paths/mix_project'),
|
||||
\ ale#handlers#elixir#FindMixProjectRoot(bufnr(''))
|
||||
|
||||
Execute(FindMixUmbrellaRoot should detect the umbrella root directory via mix.exs):
|
||||
silent execute 'file ' . fnameescape(g:dir . '/elixir_paths/umbrella_project/apps/app1/lib/app.ex')
|
||||
|
||||
AssertEqual
|
||||
\ ale#path#Simplify(g:dir . '/elixir_paths/umbrella_project'),
|
||||
\ ale#handlers#elixir#FindMixUmbrellaRoot(bufnr(''))
|
||||
|
||||
Reference in New Issue
Block a user