pragmagic / vscode-nim

An extension for VS Code which provides support for the Nim language.
Other
238 stars 37 forks source link

Formatting using nimpretty and PATH on Windows 10 (no binary issue + solution) #150

Closed guzba closed 4 years ago

guzba commented 4 years ago

I'm using this plugin and it is largely working great. I've run into an issue and found the solution. I wanted to report it here to see if anything can be done to improve this.

The issue:

After a fresh install of VS Code, choosenim devel, and installing this extension, whenever I pressed the format keyboard shortcut (or set formatOnSave to true), I received the message "No 'nimpretty' binary could be found in PATH environment variable".

If I ran nimpretty from the terminal in VS Code, everything worked as expected. I tracked the issue down to the System vs User PATH.

It appears the .nimble/bin directory is added to the User PATH variable on installation, but not the System PATH variable. Adding the .nimble/bin directory to the System PATH enabled nimpretty formatting in VS Code to start working.

Ideally adding .nimble/bin to the System PATH would not be necessary.

guzba commented 4 years ago

Seems like a conflicting install issue, redid things and now works without System PATH entry.