vitest-dev / vscode

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

Vitest VSCode fails to start without a Vitest config file #380

Closed MangelMaxime closed 2 months ago

MangelMaxime commented 2 months ago

Describe the bug

Vitest VSCode fails to start without a Vitest config file.

I am pretty sure in the past it was able to start without a config file. Also I found https://github.com/vitest-dev/vscode/issues/348 mentioning the same issue and having a fix provided for it. So perhaps this is a regression.

Reproduction

Open a repository without a Vitest config file.

Output

[INFO 20:27:00] [v0.10.2] Vitest extension is activated because Vitest is installed or there is a Vite/Vitest config file in the workspace.
[Error 20:27:00] [API] Failed to start Vitest: No vitest config files found

Version

v0.10.2

Validations

sheremet-va commented 2 months ago

The extension expects either the config or a script in package.json that starts with vitest. Starting Vitest for any project seems excessive. What if you have vitest installed globally?

MangelMaxime commented 2 months ago

What if you have vitest installed globally?

I would say this is a bad practice 😝

More seriously, I understand the reason behind the decision you are describing. Perhaps the log can be changed to explain the situation / requirements or make these requirements documented somewhere?

If they are sorry I was not able to find it.