You can now run and manage your Nim tests directly from VSCode using the new test runner.
Requirements:
Key features:
Full changelog: https://github.com/nim-lang/vscode-nim/releases/tag/v1.8.0
The language server has been updated to support the test runner, including:
Full changelog: https://github.com/nim-lang/langserver/releases/tag/v1.12.0
We extend our gratitude to the Nim team for their hard work on these improvements, the community for their feedback, the contributors for their contributions, and special thanks to Status for sponsoring the development.
Try it out and let us know what you think.
I've successfully installed/built both software on Nim 2.2.4
I see it now opening multiple nimsuggest processes and it seems to handle processes better, but the spawn logic is not clear to me: where I expect 1 nimsuggest process for each "import tree", I see different nimsuggest processes on files part of the same tree.
Another point that puzzles me is why nimsuggest executable picked by vscode extension is not the one in PATH:
second one is nowhere set in environment (terminal/vscode settings)
trying to install update nimlangserver, on windows 11, nim 2.2.2. Same error multiple times
nimble install nimlangserver
Installing [email protected]
Warning: A package "[email protected]" with checksum "0367e471e87e1eea8bfef5461db8905591186855" already exists in the cache.
Building nimlangserver/nimlangserver.exe using c backend
Warning: Package requires nim 2.0.8 but 2.2.2 found. Attempting to compile with the current nim version.
Info: compiling nim package using C:\Users\youse\.nimble\bin\nim.exe
C:\Users\youse\.nimble\pkgs2\faststreams-0.3.0-ec2d92793e7d1bd0c30ab29c0d20548a054cfa8e\faststreams\async_backend.nim(35, 12) Warning: asyncdispatch backend currently fails tests - it may or may not work as expected [User]
C:\Users\youse\.nimble\pkgs2\chronos-4.0.4-455802a90204d8ad6b31d53f2efff8ebfe4c834a\chronos\config.nim(150, 20) Error: expression cannot be cast to 'ptr SeqHeader'
Downloading https://github.com/nim-lang/langserver using git
Downloading https://github.com/status-im/nim-chronos using git
Installing [email protected]
Success: chronos installed successfully.
Installing [email protected]
Building nimlangserver/nimlangserver.exe using c backend
Info: compiling nim package using C:\Users\youse\.nimble\bin\nim.exe
C:\Users\youse\.nimble\pkgs2\chronos-4.0.3-fd6062c492e5b6053702638159d38d1219b4bf72\chronos\config.nim(150, 20) Error: expression cannot be cast to 'ptr SeqHeader'
Tip: 77 messages have been suppressed, use --verbose to show them.
nimble.nim(324) buildFromDir
Error: Build failed for the package: nimlangserver
I see different nimsuggest processes on files part of the same tree.
Likely the ns known command not returning true for the file. If you have a small repro (ideally via terminal using nimsuggest --v4), submit an issue in the nim repro so we can keep track of it.
Another point that puzzles me is why nimsuggest executable picked by vscode extension is not the one in PATH:
The nim selection is done via nimble, in particular via nimble dump (the nimlangserver does this, not the extension itself). Meaning you can set nim version you want in the nimble file.
Where can I find the test menu? Any screenshots?
PS: Thanks for the update! I posted a thread last week about how nimsuggest would spawn 20+ processes, seems it is much better now
Nice job, @jmgomez!
FYI, I noticed that the changelog shown on the VS Code extension is not up to date. The latest version that it mentions is 1.4.1.
Where can I find the test panel? Any screenshots? I installed unittest2 and ran the test.nim as before
Here you go: https://github.com/nim-lang/vscode-nim?tab=readme-ov-file#experimental-test-runner