Microsoft announced Visual Studio 2022 17.5 Preview 2 adds Sticky Scroll functionality to help improve user productivity. Sticky Scroll reminds you what code you’re editing by keeping the relevant headings stuck above the scroll view. The feature is not enabled by default, but you can enable it by going to dishes > options > Text editor > general > sticky scroll and replacing theShow the current nested ranges during scrolling at the top of the editor” possibility.
Sticky Scroll is currently a little limited in terms of the languages it supports, but it will work when editing code written in C#, C++, XAML, and JSON. Microsoft said it will continue to improve the feature so it may add Sticky Scroll support to languages in the future.
The Sticky Scroll feature will cause namespaces, classes, and methods to stick to the top of the editor when scrolling through code. The Sticky Scroll section grows and shrinks as the relevant titles move. This should help you identify which part of the code you edited without having to scroll up and look again, saving you time.
If you don’t like too much content stuck at the top of the editor, you can limit the number of lines from where you started it. Just type the number of rows you want next to “Set the maximum number of sticky lines to display:” and click Okay. To get started with the feature, download the latest version Visual Studio 2022 Preview.