gql-tag-operations-preset and vscode typescript #8345
-
Hi there! I'm using the However, one small thing I noticed is that when codegen updates the In order to get VSCode to see the new types I have to either....
Is there any recommended way to have VSCode detect the new types? Fwiw, I looked into how prisma does this, and they have a plugin that watches the generated typescript file and restarts the tsserver whenever it changes: https://github.com/prisma/language-tools/blob/main/packages/vscode/src/plugins/prisma-language-server/index.ts#L59-L80 |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Hi @ryanto, You are right, and this behavior is valid for all existing codegen plugins. |
Beta Was this translation helpful? Give feedback.
-
Code.-.page.tsx.beatgig-v3.-.1.November.2022.mp4I just fixed it by doing this. 1. Open VSCode "typescript.tsserver.watchOptions": {
"watchDirectory": "useFsEvents",
"fallbackPolling": "dynamicPriorityPolling",
"watchFile": "useFsEventsOnParentDirectory",
"synchronousWatchDirectory": true,
"excludeDirectories": ["**/node_modules/**/*"]
} I think you can exclude other directories there. I didn't do a big deep-dive into the significance of these settings, so maybe there is a better configuration. But this led to If you have suggestions for improving the JSON settings here, let me know. I think that what I picked there may be slightly aggressive with polling. I still have to play with it.
The TypeScript docs are here: https://www.typescriptlang.org/docs/handbook/configuring-watch.html |
Beta Was this translation helpful? Give feedback.
Hi @ryanto,
You are right, and this behavior is valid for all existing codegen plugins.
We don't have an existing solution or workaround for it, however, we will definitely look into providing a VSCode extension (or similar solution), and I added your request in the v3 roadmap: #8296.