summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJon Parise <jon@indelible.org>2018-11-01 13:35:18 -0700
committerJon Parise <jon@indelible.org>2018-11-04 06:40:25 -0800
commitb25794e81b79d4ce1a6f2d9d0fbcc6876ecaa124 (patch)
treec181230a071ac6d52e1161090eb223e47255c31e /test
parentacdc99b94daf0f14a8a71d1de5656e9f612a0139 (diff)
downloadale-b25794e81b79d4ce1a6f2d9d0fbcc6876ecaa124.zip
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.
Diffstat (limited to 'test')
-rw-r--r--test/command_callback/elixir_paths/umbrella_project/apps/app1/lib/app.ex0
-rw-r--r--test/command_callback/elixir_paths/umbrella_project/apps/app1/mix.exs0
-rw-r--r--test/command_callback/elixir_paths/umbrella_project/apps/app2/lib/app.ex0
-rw-r--r--test/command_callback/elixir_paths/umbrella_project/apps/app2/mix.exs0
-rw-r--r--test/command_callback/elixir_paths/umbrella_project/mix.exs0
-rw-r--r--test/command_callback/test_elixir_ls_command_callbacks.vader4
-rw-r--r--test/command_callback/test_elixir_mix_command_callbacks.vader15
7 files changed, 13 insertions, 6 deletions
diff --git a/test/command_callback/elixir_paths/umbrella_project/apps/app1/lib/app.ex b/test/command_callback/elixir_paths/umbrella_project/apps/app1/lib/app.ex
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/command_callback/elixir_paths/umbrella_project/apps/app1/lib/app.ex
diff --git a/test/command_callback/elixir_paths/umbrella_project/apps/app1/mix.exs b/test/command_callback/elixir_paths/umbrella_project/apps/app1/mix.exs
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/command_callback/elixir_paths/umbrella_project/apps/app1/mix.exs
diff --git a/test/command_callback/elixir_paths/umbrella_project/apps/app2/lib/app.ex b/test/command_callback/elixir_paths/umbrella_project/apps/app2/lib/app.ex
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/command_callback/elixir_paths/umbrella_project/apps/app2/lib/app.ex
diff --git a/test/command_callback/elixir_paths/umbrella_project/apps/app2/mix.exs b/test/command_callback/elixir_paths/umbrella_project/apps/app2/mix.exs
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/command_callback/elixir_paths/umbrella_project/apps/app2/mix.exs
diff --git a/test/command_callback/elixir_paths/umbrella_project/mix.exs b/test/command_callback/elixir_paths/umbrella_project/mix.exs
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/command_callback/elixir_paths/umbrella_project/mix.exs
diff --git a/test/command_callback/test_elixir_ls_command_callbacks.vader b/test/command_callback/test_elixir_ls_command_callbacks.vader
index 5a8d8496..ca785054 100644
--- a/test/command_callback/test_elixir_ls_command_callbacks.vader
+++ b/test/command_callback/test_elixir_ls_command_callbacks.vader
@@ -22,12 +22,12 @@ Execute(should configure elixir-ls release location):
AssertLinter 'boo/language_server.sh', 'boo/language_server.sh'
Execute(should set correct LSP values):
- call ale#test#SetFilename('mix_paths/wrapped_project/lib/app.ex')
+ call ale#test#SetFilename('elixir_paths/umbrella_project/apps/app1/lib/app.ex')
AssertLSPLanguage 'elixir'
AssertLSPOptions {}
AssertLSPConfig {}
- AssertLSPProject ale#path#Simplify(g:dir . '/mix_paths/wrapped_project')
+ AssertLSPProject ale#path#Simplify(g:dir . '/elixir_paths/umbrella_project')
Execute(should accept configuration settings):
AssertLSPConfig {}
diff --git a/test/command_callback/test_elixir_mix_command_callbacks.vader b/test/command_callback/test_elixir_mix_command_callbacks.vader
index 9315a850..ec7b9911 100644
--- a/test/command_callback/test_elixir_mix_command_callbacks.vader
+++ b/test/command_callback/test_elixir_mix_command_callbacks.vader
@@ -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(''))