Full disclosure: I’ve been guilty of this bad behavior, so while correcting myself, I’ve tried to point out this itty-bitty, teensy-weensy, teeny-tiny little feature in VS Code. I think it’s more of a feature in the PowerShell extension than VS Code itself, but maybe not. It kind of ties into “code folding”, sort of, kind of, but anyway, I’ll hum a few notes…

When you’re scrolling in some horrific steamy fly-infested pile of code, that I might have written, but cannot confirm or deny, and that putrid code contains #region or function statements, you can quickly jump back up to the start of that #region or function by clicking in the breadcrumb trail along the top.
Let’s say you organize your code, I know, stop laughing, just hear me out… in such a way that you have C:\Code\SmellyCode\RottingCode\PoorCustomer\Scripts\Runbooks\ and your file sits right there, waiting for the chalk outline to be drawn before they bag it and take it away. And you’ve opened it, with nitrile gloves, face mask and body suit, of course, and you start scrolling down to say, line 2424 out of 345,230,444,042 total lines. I just mad that up. I think it’s the U.S. national debt, but don’t quote me. You’re deep inside this function and just remembered that a particular variable is defined higher up near the first line within the function: Just click one of the function links (see example below, green stuff).
Or maybe you realize that line 2467 makes a call to a function defined in the same script, but near the start of the #region: well, you can click the region link (see example below, yellow stuff)
The weird squiggly green thing to the left below is just to point out the gap in line numbering to show you how far you’ve stuck your inside inside this corpse. I think this example is roughly like inserting your hand near the eye socket and reaching inside down to the intestines, or something like that. I just finished watching the last episode of The Pitt, so my brain is on medical drama mode. Sorry about that.

Anyhow, I hope you found this useful. If not, get outside and enjoy some fresh air. You’ll forget you ever read this far.
Thanks!

One thought on “Microscopic Visual Studio Code Tips for Microscopic Needs”