We are pleased to announce that new versions of nimlangserver, the nim-lang.org VSCode extension, and nimble have been released.
We have reworked the project discovery in nimlangserver to better handle nimsuggest. It now uses nimble dump to select the nimsuggest version and determine the project's entry points. We have also implemented other features and bug fixes.
Release notes: https://github.com/nim-lang/langserver/releases/tag/v1.4.0
For the VSCode extension, we have moved nimlangserver notifications to a dedicated panel to reduce the noise users receive from the extension. Additionally, we have added information about the current status of nimlangserver, including the number of nimsuggest instances running. The extension now automatically downloads and installs nimlangserver if it is not found in the path. In the future, we aim to create custom panels for running tests and nimble tasks.
Release notes: https://github.com/nim-lang/vscode-nim/releases/tag/v1.0.0
There has been significant effort put into nimble. We aim to polish existing features, improve stability, and integrate ideas from Atlas so that they eventually converge into one package manager. As a start, we now have the SAT solver integrated into nimble in experimental mode. Before making it the default (--solver:sat), please test it with your projects to ensure it works fine.
Full notes for the nimble release: https://github.com/nim-lang/nimble/releases/tag/v0.16.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.
Great work! 👏
Thanks for leading the effort there and for the update! 🙏
Thanks a lot for your hard work on nim's tooling. I think this is one of the most important things that can be done to make nim more popular and even more pleasant to use.
Sorry if this question is obvious, but how do you update nimble independently of nim? Or should we simply do a choosenim update devel to get this new nimble version?
Also, I heard that there was some (planned?) work to make nimble able to replace choosenim, which hopefully will fix the problems related to orphan nimsuggest processes when using the VS Code extension on Windows. Can you give an update of what is the status of that work (if any)?
.Sorry if this question is obvious, but how do you update nimble independently of nim? ```nimble install nimble``` it said it installed [email protected], but ``` nimble -v``` results in ``` nimble v0.14.2 compiled at 2024-07-03 01:22:18 git hash: couldn't determine git hash``` so there's a bit more to do (at least on windows)
You can also download the nimble binaries from the release page (I just updated it). It will also be shipped with the next Nim release.
nimble install nimble Likely the nimble you still have in your path is the old one but I agree that it should be enough and same for switching nim versions (maybe with an extra flag for the replacing the path)
Will the next release of Nim 2.2.0 include Nimble 0.16.0 ?
Yes.
Many thanks for the updates!
However, there are a couple items of concern.
First, when I pulled the latest vscode-nim code from github, it refused to build (nim v2.0.8):
[~/xxxx/vscode-nim]$ nimble vsix
Verifying dependencies for [email protected]
Executing task vsix in ~/xxxx/vscode-nim/nimvscode.nimble
(node:49474) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
Executing prepublish script 'npm run vscode:prepublish'...
> [email protected] vscode:prepublish
> nimble release
Verifying dependencies for [email protected]
Executing task release in ~/xxxx/vscode-nim/nimvscode.nimble
<<<< Snip - assorted Hint and Warning messages >>>>
.......
~/xxxx/vscode-nim/src/nimLsp.nim(475, 5) Error: expression expected, but found 'keyword return'
stack trace: (most recent call last)
/tmp/nimblecache-1746932643/nimscriptapi_4059799742.nim(212, 16)
~/xxxx/vscode-nim/nimvscode.nimble(27, 3) releaseTask
/opt/nim-2.0.8/lib/system/nimscript.nim(265, 7) exec
/opt/nim-2.0.8/lib/system/nimscript.nim(265, 7) Error: unhandled exception: FAILED: nim js -d:release -d:danger --outdir:out --checks:off --sourceMap src/nimvscode.nim [OSError]
Tip: 1 messages have been suppressed, use --verbose to show them.
nimscriptwrapper.nim(161) execScript
Error: Exception raised during nimble script execution
ERROR npm failed with exit code 1
stack trace: (most recent call last)
/tmp/nimblecache-1746932643/nimscriptapi_4059799742.nim(212, 16)
~/xxxx/vscode-nim/nimvscode.nimble(34, 3) vsixTask
/opt/nim-2.0.8/lib/system/nimscript.nim(265, 7) exec
/opt/nim-2.0.8/lib/system/nimscript.nim(265, 7) Error: unhandled exception: FAILED: npm exec -c 'vsce package --out out/nimvscode-1.0.0.vsix' [OSError]
Tip: 2 messages have been suppressed, use --verbose to show them.
nimscriptwrapper.nim(161) execScript
Error: Exception raised during nimble script execution
I thought perhaps the problem might be that the build requires the latest version of nimble. This brings me to the second problem - the latest nimble release binaries do not include a 64-bit version for Linux.
Am I correct in assuming that I can just download the file nimvscode-1.0.0.vsix binary from the github vscode-nim release page and directly sideload it into vscode, without bothering with a build?
I thought perhaps the problem might be that the build requires the latest version of nimble. This brings me to the second problem - the latest nimble release binaries do not include a 64-bit version for Linux.
For some reason the upload failed, should be up now.
Am I correct in assuming that I can just download the file nimvscode-1.0.0.vsix binary from the github vscode-nim release page and directly sideload it into vscode, without bothering with a build?
Yes
Nice! Will this version of the extension be in the VSCodium/VSX extension marketplace? :)
We dont have an official Nim account there yet
Now VSCode always fails with Nim Language Server client: couldn't create connection to server. and Server initialization failed. Message: Pending response rejected since connection got disposed Code: -32097
Am I missing some important step or something?
I was helping someone get started with Nim, and the proper VScode Nim extension not being on open-vsx.org turned out to be a significant initial turn-off...
Turns out that many distros install the OSS version of VScode by default. The OSS version uses open-vsx.org, and the Nim extension there hasn't been updated in years. All documentation refers to the official proprietary Microsoft edition, and doesn't mention OSS / Codium / etc.
For example, an Arch Linux user needs to switch from the code package in the standard repository to the visual-studio-code-bin package in AUR (the less-vetted harder-to-install user repository).
https://itsfoss.com/vs-code-vs-codium/
Took me some time to figure this out. I didn't see any of the Nim documentation explaining the different VScode variants...