Search code examples
c#visual-studiovisual-studio-2022

Visual Studio 2022: cannot find tool that I enabled


I enabled a tool and want to remove it, but I don't know what it's called
I'm hoping that someone will know what it's called so I can find it to disable it.

Why can't I just Google it? I can't come up with a string to put into a search engine that gives me any results.

How to you know it's a tool and not an extension?
I don't have a lot of extensions installed, so it was easy to look through my installed extensions and determine that the functionality that I want to get rid of isn't an extension.

Describe the functionality
The tool shows what "level deep" you are in your code, i.e. "code that triggers an indentation". "if" checks, method calls, anything that would cause a new level of indentation to happen.

I realize that's not a great description, which is the entire problem. Allow me to show you...

Here's a screen shot:
enter image description here

You see at the top of the code lines 14, 16, 203, 205, and 207 are highlighted. These are all lines that trigger a new indentation on the next line.

It's dynamic. If I move up or down, it'll change. Here's what happens when I move up to where there's only two lines causing indentation:
enter image description here

I can't figure out where I turned this tool on!
If anyone knows, I'd truly appreciate if you could pass on that knowledge.

Funnily enough, I "repaired", and I thought that would remove the tool. It didn't. I don't want to have to reinstall.

EDIT: IT'S CALLED STICKY SCROLL

The kind soul below told me. See Neil T's answer below.


Solution

  • This feature is called Sticky Scroll. It's available in Visual Studio 2022, first previewed in version 17.5.

    You can enable or disable it in Visual Studio by going to Tools > Options > Text Editor > General and editing the Sticky scroll section.

    To help anyone else searching for this, I'll quote Microsoft's description of this feature:

    When you work in a large code file or scroll through an unfamiliar codebase, sometimes it can be difficult to tell where you are in the code. With Sticky Scroll, you can stick scopes to the top of the editor so that they're always in view while you scroll through your code.

    There's a full description with screenshots from Microsoft here. I've copied one of the screenshots below.

    (Ironically this is one of the very few new features added to any Microsoft application recently that I've found useful!)

    'Sticky scroll' screenshot