Integrated Development Environments Superpowers 13 exercises

Restarting the TypeScript Server in VS Code

We've discussed several examples of the cool things the TypeScript server can do for you in VS Code.

However, if configurations are adjusted or files in the .gitignore are changed, TypeScript may not notice and end up being out of sync with your code.

In these situations, you may need to reset t

Loading explainer


00:00 We've been talking about the TypeScript server, the TS server that runs in VS Code in glowing terms, you know, it does all of these cool things for you, gives you autocomplete, gives you rename symbol, gives you loads and loads of cool stuff. But sometimes you will need to do something not very

00:16 nice to it. Sometimes you'll need to reset it. This can happen when like configurations change in TS and it's not quite doing what you think it's doing. Sometimes it gets out of sync in funny ways because it doesn't notice that a file changed, for instance, when it's git ignored. And resetting the

00:32 TS server is always really good to have in your back pocket just in case. So we will look at examples of when we might need to use it later on, so I will just give it to you now as a way that you know you can do it just at any time. So if you ever think that TypeScript's doing some weird stuff

00:47 or being maybe a little bit slow, what you can do is you can go command shift p and we can go reset TypeScript or sorry restart TypeScript server. There it is. We can restart the ESLint server if you've got the ESLint thing, but it's TypeScript that we really care about. This will take just a couple of seconds to happen and then it just kicks into gear again. No fanfare

01:07 or anything, it just restarts. And then it means that it can sort of relook at your files and make sure the errors you're seeing are correct. So there you go, restarting the TypeScript server.