When I am working with Angular projects TypeScript IntelliSense made me crazy with its unexpected loading behaviour. I had to wait for a long time to end the loading in the suggestion panel. but most of the time the results weren’t shown. I found there are several answers related to tsconfig.json but didn’t work for me. This only had with VS Code and WebStorm worked well without any issues.
typescript.tsdk defines the “global” or “workspace” TypeScript version (depending on whether it’s a user or workspace setting). First, check for your Typescript version running. Check bottom status bar in VS Code to find it.
What I went through with this…
My current TypeScript version is 3.7.5 at the time I was taking this snap. If your version is lesser than that try updating it by click on the number. You will see something like this. If your global install of TypeScript was pointed to the wrong location select Use Workspace Version to get with the latest version from your updated project with dependencies, else you can update VS Code as well.
Next, Try checking VS Code user settings. Go to File -> Preferences-> Settings or press Ctrl + ` to open the settings window.
Then, Search for TypeScript and select TypeScript from the list as below.
Select Edit in settings.json. You will find typescript.tsdk key and remove it.
This may fix your issue. If not we have to add TypeScript server manually.
npm root -g
Use the above command to get the npm root location and update it with typescript server location as follows.
This is the location where TypeScript server tsserver located.
Create new key as typescript.tsdk in settings.json and add the above location as value. Then save the file and Type loading a suggestion.
For More information about Compiling TypeScript in Visual Studio Code check this link from VS Code website. This article has the compiling mechanism in detail.
Thanks for reading. Did this article help you out? If it did, I hope you consider sharing it. You might help someone else out. Let me know your thoughts in comments as well. Thanks so much!