Closed janpio closed 4 years ago
Update: The extension can monitor files with a specific path and do something on changes, but apparently the node_modules
folder is excluded from that.
There's a files.watcherExclude
setting with the following defaults:
"files.watcherExclude": {
"**/.git/objects/**": true,
"**/.git/subtree-cache/**": true,
"**/node_modules/*/**": true,
"**/.hg/store/**": true
}
Excluding large folders is used to reduce the initial load on startup of VSCode. Performance-wise it's probably not advisable to remove node_modules from here either, since it can contain a lot of files. But there is an issue to exclude all files except a specific one (https://github.com/microsoft/vscode/issues/869). Since this is a user setting though, we cannot set this inside the extension.
In https://github.com/prisma/language-tools/pull/357, a solution for the VSCode extension got implemented. A file watcher is added to **/.prisma/client/*.d.ts
, restarting the TS Language Server if something changes inside the watched files.
I'm not 100% sure that the solution in #357 is working correctly. I'm still finding that I need to manually restart the ts-server to refresh types, and I think @burnsy reported the same to me.
This regression was fixed in #443.
What happened: To be able to solve the problem of hanging types, our solution was to restart the TS Language Server on every change to node_modules/.prisma/client/index.d.ts
. In order to detect changes to this file, we had to change the workspace settings, otherwise changes to node_modules
were ignored by default. However, this solution only worked if the prisma project was opened with a workspace.
We now are detecting changes with a different file watcher (chokidar), which does detect changes to the node_modules
folder and also works independently of having the project opened as a folder or a workspace.
Please try out 2.6.0 and let us know if there are any issue with it.
That was amazingly fast, thanks so much!
Doesn't look like it works with pnpm mono repo.
Please open a new issue then @gruckion and explain how to reproduce. Thanks.
https://github.com/prisma/prisma/issues/2962 and https://github.com/prisma/prisma/issues/2771 describe a problem with outdated TypeScript types after generation. That is bad for our users.
In https://prisma-company.slack.com/archives/CKCQQGXJM/p1594197337043400 (internal) we came up with a possible way to work around this via an implementation in our LSP.