'VSC Default Directory for IntelliSense?

I use the code-runner extension in VSC to run untitled files on the fly, which is super helpful for quickly testing code snippets. Under the hood, the extension creates a temporary file in a directory I've specified which already has some packages preinstalled. This way if I need to build an express server or use some other common package, the code already has access to those packages.

But while code-runner works just fine, TS/IntelliSense doesn't. TS or IntelliSense doesn't know what directory untitled files will be run in, and so either the TS compiler complains about packages it can't find, or IntelliSense gives me typings for a different version of that package from whatever project I may have open in a separate tab. So basically, for untitled files in Visual Studio Code, how can I tell TypeScript/IntelliSense which directory it should look for packages in?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source