-
Notifications
You must be signed in to change notification settings - Fork 198
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[META] Issues with Run test Code Lense #438
Comments
|
elixir-ls simply responds to the LSP Code Lens Request. The exact events that trigger this request are indeed editor specific. @lukaszsamson I'll try to fix some of these in the coming weeks, I've already got some ideas. |
Should be fixed by #442. |
I've been looking into changing the method for detecting test files to use Handling basic projects is fairly easy, but umbrellas are another story. I've thought of a few possible solutions but none of them feels completely satisfactory (in no particular order):
I've looked around ElixirLS and ElixirSense a bit to see if there would be some existing functionality to help with this, but didn't find anything. I would obviously love if there was indeed something we could use! Lastly, I think it's important to keep in mind that no solution will perfectly shield us from the most funky project configurations, where PS: Sorry for the wall of text 😅 |
Should be fixed before on-by-default? #485 test lens doesn't escape the test name properly |
I have this issue where I'm using VSCode on Windows, but my terminal is using WSL. This means ElixirLS thinks the paths are Windows ones but they're invalid once they reach WSL which makes the generated |
@ZeLarpMaster This issue has to do with the VS Code extensions itself more so than elixir-ls, but I couldn't find a way to handle this automatically (doesn't look like vscode's API exposes which shell is running inside the terminal). I guess a config is the best we could do. |
I see
is already marked as done but I've run into the issue today when getting the newest version. |
Just to be sure, by "getting the newest version" you mean that you had cloned the repo and the past and recently tried to pull the latest version? If so, this is expected behaviour.
We did consider this when implementing the fix, but decided that simply moving the tmp folder somewhere else was simpler and cleaner. Jason did however remove the old You can read all the discussion regarding this in the relevant PRs: #463 and #482. |
@Blond11516 Yes, I cloned the repo in the past and upgraded recently. Thank you for pointing out the discussions. I missed the fact that |
I was playing around with this before writing the documentation and I found a new issue (only remotely relate do the test lenses). It seems that running a specific file from an umbrella's root causes weird dependency resolution failures. A good example of this is elixir-ls itself. From the repo root, running the command
Changing the import of
Everything seems to be fine when running the same command from This isn't an issue with the test lenses themselves, but I still find it relevant since it could be fixed by navigating to the proper app folder before attempting to run the test. Is this a known issue of either the elixir-ls project or umbrella apps in general? I have little experience with umbrella apps but couldn't reproduce this issue with a simple test app. |
@Blond11516 note that in this project there is an alias on
@axelson do we really need that alias? |
If we can get rid of the alias, that would be great. |
Well, the result is different, but the tests still don't work, so while it would indeed be great I guess it's gonna have to be a whole different discussion. |
All the issues are addresses |
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 #278Doesn't work properly in multi-root workspaces Run test command broken in multi-root workspaces vscode-elixir-ls#161
run test
ontest
insidedescribe
runsmix test
but the intended test is excludedExUnit.CaseTemplate
are not foundInitial investigation shows that elixir_sense often does not return any imports for such tests, e.g.
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
run tests
is often misplaced somewhere inside module codereproducible by a test with
do
on the next line likeI'll update this meta issue with some code that reproduces those issues.
@Blond11516 feel free if you are interested in tackling any of those.
The text was updated successfully, but these errors were encountered: