vitest-dev / vscode

VS Code extension for Vitest
https://vitest.dev/vscode
MIT License
729 stars 79 forks source link

bugfix(utils): add volta support on win32 #384

Closed Esurnir closed 2 months ago

Esurnir commented 2 months ago

This only works if the installation folder is "Volta". I don't know how to check for volta otherwise.

I only have a windows machine, I don't know volta's behaviour on linux so I can't check what will happen there.

Fix #382

Esurnir commented 2 months ago

For your information here's a reply I got from Chuck Pierce from the Volta discord to my question about detecting's Volta presence on Windows :

"For detecting the presence of Volta on Windows I could see a couple of similar approaches:

  1. The approach of finding the path and searching it for Volta actually may be the least intrusive, since it’s a straightforward string match. It’s not technically the most robust, as a user could theoretically have changed the install directory to be something else (that doesn’t also include “Volta” somewhere), but I would wager that’s quite rare.
  2. Don’t try to detect it a priori, run volta which node and see if it succeeds. If it does, Volta is there and you get the value you need, if it fails, then you can fall back."