-
Notifications
You must be signed in to change notification settings - Fork 217
Closed
Labels
bugSomething isn't workingSomething isn't workinghelp wantedExtra attention is neededExtra attention is needed
Description
I played with the new code lense and found a few issues that will need to be sorted out before we can enable it by default.
-
server instance id needs to be checked, see Add unique server id #278
Doesn't work properly in multi-root workspaces Run test command broken in multi-root workspaces vscode-elixir-ls#161 - often clicking
run test
ontest
insidedescribe
runsmix test
but the intended test is excluded - in some cases tests defined with
ExUnit.CaseTemplate
are not found
Initial investigation shows that elixir_sense often does not return any imports for such tests, e.g.
use MyApp.Web.ConnCase
Edit: this happens when elixir-ls MIX_ENV is not set to test - in that case /test/support
is not compiled and elixir_sense is unable to expand the case template macro.
IMO we should drop the imports check as it's too ureliable
- module level
run tests
is often misplaced somewhere inside module code - run tests on dirty file should trigger save (or warn if that's not feasible)
- umbrella behaviour is far from optimal - test is run for every app in umbrella
- tests fail to run with
mix test
==> elixir_ls_utils
Excluding tags: [pending: true]
== Compilation error in file test/tmp/ElixirLS.LanguageServer.ServerTest/test returns code lenses for runnable tests/test/fixture_test.exs ==
** (CompileError) test/tmp/ElixirLS.LanguageServer.ServerTest/test returns code lenses for runnable tests/test/fixture_test.exs:1: cannot define module TestCodeLensTest because it is currently being defined in test/tmp/ElixirLS.LanguageServer.ServerTest/test does not return code lenses for runnable tests when test lenses settings is not set/test/fixture_test.exs:1
(stdlib 3.13.2) erl_eval.erl:680: :erl_eval.do_apply/6
** (exit) 1
(mix 1.12.0-dev) lib/mix/tasks/cmd.ex:64: Mix.Tasks.Cmd.run/1
(mix 1.12.0-dev) lib/mix/task.ex:394: Mix.Task.run_task/3
(mix 1.12.0-dev) lib/mix/project.ex:352: Mix.Project.in_project/4
(elixir 1.12.0-dev) lib/file.ex:1554: File.cd!/2
(mix 1.12.0-dev) lib/mix/task.ex:511: anonymous fn/4 in Mix.Task.recur/1
(elixir 1.12.0-dev) lib/enum.ex:2270: Enum."-reduce/3-lists^foldl/2-0-"/3
(mix 1.12.0-dev) lib/mix/task.ex:510: Mix.Task.recur/1
(mix 1.12.0-dev) lib/mix/project_stack.ex:181: Mix.ProjectStack.recur/1
- Crashes when test context spans more than 1 line
** (MatchError) no match of right hand side value: nil
(language_server 0.6.2) lib/language_server/providers/code_lens/test.ex:93: anonymous fn/5 in ElixirLS.LanguageServer.Providers.CodeLens.Test.find_test_blocks/4
(elixir 1.12.0-dev) lib/enum.ex:2270: Enum."-reduce/3-lists^foldl/2-0-"/3
(language_server 0.6.2) lib/language_server/providers/code_lens/test.ex:81: ElixirLS.LanguageServer.Providers.CodeLens.Test.find_test_blocks/4
(language_server 0.6.2) lib/language_server/providers/code_lens/test.ex:39: ElixirLS.LanguageServer.Providers.CodeLens.Test.code_lens/2
(language_server 0.6.2) lib/language_server/server.ex:696: anonymous fn/3 in ElixirLS.LanguageServer.Server.handle_request/2
(language_server 0.6.2) lib/language_server/server.ex:748: anonymous fn/3 in ElixirLS.LanguageServer.Server.handle_request_async/2
reproducible by a test with do
on the next line like
test "some test", %{
} do
end
- Test lens doesn't escape test name properly #485 test lens doesn't escape the test name properly
I'll update this meta issue with some code that reproduces those issues.
@Blond11516 feel free if you are interested in tackling any of those.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workinghelp wantedExtra attention is neededExtra attention is needed