Yep, that works for me too. What I was trying to say is that 3rd party libs (inside node_modules) are not cached or read eagerly, and until you don't import something from the library, you won't have intellisense for that.
I wanted to know if it was possible to tell vscode to load eagerly some libs (we have a few private packages we use in our apps).
The reason for not loading node modules eagerly:
This is an intentional performance/helpfulness trade-off.
We don't eagerly consume all .d.ts files from node_modules - doing so would be prohibitively expensive in a world where there are regularly possible thousands of definition files in node_modules.
When the Angular .d.ts file isn't consumed, we have no way of knowing that NgModule happens to come from @angular/core, thus can't suggest that auto-import.
Although, you can achieve it using the way mentioned here:
Auto complete is one of my favorite features of VS code. But sometimes it doesn't provide what I need.
Steps to Reproduce:
npx create-react-app test-auto-complete --typescript
cp -r node_modules/safe-touch node_modules/@types
So it seems that VS code is not able to auto complete types of node_modules/[package] even if the package is correctly typed?
Does this issue occur when all extensions are disabled?: Yes/No
Amazing! I didn't knew that! Those are really helpfull links. Thank you @shhdharmen
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.