CodexBloom - Programming Q&A Platform

VSCode Snippets Not Expanding for TypeScript in Monorepo with Project References

๐Ÿ‘€ Views: 84 ๐Ÿ’ฌ Answers: 1 ๐Ÿ“… Created: 2025-06-01
vscode typescript monorepo TypeScript

I'm integrating two systems and I'm learning this framework and I've been banging my head against this for hours... Quick question that's been bugging me - I'm having trouble getting my VSCode snippets to expand when I'm working in a TypeScript project within a monorepo setup. I have a workspace configured with multiple projects that use TypeScript project references, and while the snippets work perfectly in standalone projects, they unexpected result to expand in the sub-projects of the monorepo. For example, I created a simple snippet for a function in my `snippets.code-snippets` file: ```json { "Print to console": { "prefix": "log", "body": [ "console.log('$1');" ], "description": "Log output to console" } } ``` Despite the snippet being defined and the file being included in the workspace, when I type `log` and press `Tab`, nothing happens. I've checked my settings in `settings.json` and ensured that `editor.snippetSuggestions` is set to `inline`, and `typescript.enablePromptUseWorkspaceTsdk` is true. Hereโ€™s the relevant part of my `tsconfig.json` in the root of the monorepo: ```json { "compilerOptions": { "composite": true, "declaration": true, "outDir": "dist", "rootDir": "src" }, "include": [ "packages/*/src/**/*.ts" ] } ``` I've also tried restarting VSCode and reloading the window, but it hasnโ€™t resolved the scenario. Additionally, I verified that there are no syntax errors in my snippet file and that itโ€™s correctly located in the project structure. Can anyone suggest what might be causing this scenario or how I can debug it further? My development environment is Windows. Any ideas what could be causing this? I'd be grateful for any help.