Creating a Vendor Index for VS Code (specifically for PHP Intelephense) to make code completion suck less
If you are working on a crappy server with VS Code remote development, you can easily OOM it with your code completion. This often manifests as it all just stops working and you never see another suggestion ever again. The cause tends to be the /vendor/ directory has a billion files in it thanks to the Google SDK, or being lazy allowing the project to install 45% of four different PHP frameworks instead of just writing 100 lines of code yourself. The settings for PHP Intelephense are woefully incapable of dealing with this in any manner I was happy with. So this is the way I have come up with to emulate a whitelist of directories to scan instead of screwing around with its infuriating method to blacklist them.
I don't mean to sound angsty (false) but I have been struggling with this for years and the larger a project grows, the faster VS Code will kill the 6$ DigitalOcean server with nodejs crap, despite that instance being 9000% stronger than the web app needs to run.

Step 1: Disallow /vendor/ completely.

There are a handful of things you probably don't want it to scan, but the important thing here is that you just completely blacklist the vendor directory. In this example I blacklist everything common in our projects except for 1 folder I haven't told you about yet.
"intelephense.files.exclude": [ "{.git,.github,.vscode,backups,bin,data,logs,phinx,temp,www,vendor}/**" ],

If you want to go full bore on saving your poor 2GB of RAM be sure to make "files.watcherExclude" and "search.exclude" exclude the vendor directory as well, but I think this is optional because in all of my struggles it was Intelephense's indexer dying on me.

Step 2: Create .vendex (vendor index) directory.

I chose this name because I already have .git and .vscode things, and once you set this you forget this just like those. Additionally, I like to stick -dex on the ends of things that are lists.

Step 3: Symlink things from vendor to .vendex

This is the magic. Pick and choose. VS Code / Intelephense can now go hog wild in a contained environment. Maybe you are a big fan of ramsey/uuid and would like your editor to actually provide completion for that API.
ln -sr vendor/ramsey .vendex

Maybe you are working with Monolog in a project and would like to support that too.
ln -sr vendor/monolog .vendex

Maybe you are using Symfony CSS Selectors, only that, and none of the other 40 Symfony packages that got installed without you really knowing what they are being used by.
ln -sr vendor/symfony/css-selector .vendex

By the way you can do this on Windows too. You will have either needed to edited your system GroupPolicy or be admin because Windows by default won't allow normal users to do it. Notice the windows command arguments are backwards compared to Unix style ln commands.
mklink .vendex\ramsey vendor\ramsey /j

How VSCode displays the .vendex.
How VSCode displays the .vendex.
That is literally all there is to it. Hit Ctrl+P or Flower+P type reindex choose the Intelephense one. Hopefully you have working stuff within a few seconds instead of 15 minutes that just dies 10 seconds later.
I have been also using this method to audit third party libraries. Why is my vendex so much smaller than my vendor? Should I look for an alternative to overcome a library that was written lazy? Should we just write our own in house and drop 19 dependencies?
My framework which you have no reason to want to use, even built a little tool to auto create .vendex and link in its own libraries. Lots of ways to expand on this idea.