vitest-dev / vscode

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

Disable warning when opening a project without Vitest #387

Closed GRA0007 closed 1 month ago

GRA0007 commented 1 month ago

Describe the bug

Vitest shows a warning every time I open a project that uses Vite but does not use Vitest. https://github.com/vitest-dev/vscode/blob/49d8e8306dc46e68ffbb434a524bfc497646e306/src/api/pkg.ts#L41

I do not always use Vitest for various reasons, so I should be able to disable this warning with a setting like vitest.warnIfNotInstalled = false. A button on the warning like "Don't remind me again" could set this setting.

Reproduction

Open any project that uses Vite but does not use Vitest

Output

[INFO 13:50:07] [v0.10.7] Vitest extension is activated because Vitest is installed or there is a Vite/Vitest config file in the workspace.
[Error 13:50:07] [API] Vitest not found for file:///Users/*/projects/*/vite.config.ts.
[Error 13:50:07] [API] Failed to start Vitest: No vitest config files found

Version

0.10.7

Validations

sheremet-va commented 1 month ago

I don't think it makes sense to have an option to do that, but we should ignore the warning automatically if there is no Vitest config/vitest in package.json dependencies