You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using a dev container, i.e. the VS Code extension for remote development.
Settings are stored in the usual .vscode/settings.json file.
When I change settings for this extensions, they are not picked up automatically as is the case for all other extensions I use. Instead I need to reload the VS Code window each time I make changes to the extensions settings.
This is quite surprising. I wasn't aware of it and spent considerable amount of time wondering whether I was changing the right settings. This waste of time is avoidable by doing what other extensions do, namely automatically reloading the configuration.
Also, it'd be nice if the extension would make it easier to set it up for pnpm and vitest, e.g. through better documentation or through a better set of settings.
For completeness I should mention that because we are using pnpm, we have removed "npm" from our dev containers. So it's essentially a node.js environment with "pnpm" instead of "npm". Therfore, I am of the opinion, that a configuration that shows "pnpm" as the package manager should not use "npm" for any of the other settings, e.g. preTest or postTest.
Extra: Sample Configuration for pnpm and vitest for Debugging and Running Tests
Note, this solution works only if you have a standard path to the directory containing your package.json file.
In my package.json file I added this script (other content left out for brevity):
Note that the path in the preTest setting is specific to my environment. Since we are using dev containers we can standardize this across a large number of (all?) source code repositories, and it still works for all engineers despite of which directory they use for checking out the repository on their computer. It may be possible to set env variables and then use them as follows in settings.json:
{
"some.setting": "${env:MY_VARIABLE}"
}
I did not explore this option, though, as our paths are standardized inside the dev containers.
To make the command "Debug (Vitest") work, this launch configuration works for us:
The Issue
I'm using a dev container, i.e. the VS Code extension for remote development.
Settings are stored in the usual
.vscode/settings.json
file.When I change settings for this extensions, they are not picked up automatically as is the case for all other extensions I use. Instead I need to reload the VS Code window each time I make changes to the extensions settings.
This is quite surprising. I wasn't aware of it and spent considerable amount of time wondering whether I was changing the right settings. This waste of time is avoidable by doing what other extensions do, namely automatically reloading the configuration.
Also, it'd be nice if the extension would make it easier to set it up for
pnpm
andvitest
, e.g. through better documentation or through a better set of settings.For completeness I should mention that because we are using pnpm, we have removed "npm" from our dev containers. So it's essentially a node.js environment with "pnpm" instead of "npm". Therfore, I am of the opinion, that a configuration that shows "pnpm" as the package manager should not use "npm" for any of the other settings, e.g.
preTest
orpostTest
.Extra: Sample Configuration for
pnpm
andvitest
for Debugging and Running TestsNote, this solution works only if you have a standard path to the directory containing your package.json file.
In my
package.json
file I added this script (other content left out for brevity):Then in
.vscode/settings.json
I have these settings for the extension (other content left out for brevity):Note that the path in the preTest setting is specific to my environment. Since we are using dev containers we can standardize this across a large number of (all?) source code repositories, and it still works for all engineers despite of which directory they use for checking out the repository on their computer. It may be possible to set env variables and then use them as follows in
settings.json
:I did not explore this option, though, as our paths are standardized inside the dev containers.
To make the command "Debug (Vitest") work, this launch configuration works for us:
The text was updated successfully, but these errors were encountered: