Visual Studio 2017 & 2019 highlight occurrences of selected word in scrollbar

.NetVisual Studio-2017HighlightVisual Studio-2019

.Net Problem Overview


When I mark a word (of any kind) I would like all occurrences (in that particular file) of that word to be highlighted in the scrollbar on the right hand side.

This was a feature in VS2015 and VS2013. I cannot imagine that they removed it, I just don't know how to switch it on. None of the apparent possibilities in Tools -> Options (image) helps me. enter image description here

Ps. I am using Visual Studio 17 Professional. Thank you.

.Net Solutions


Solution 1 - .Net

> This was a feature in VS15 and VS13.

Actually it was not.

It is a feature of the Productivity Power Tools extension. That extension is now just an installer for separate single feature extensions. I think you'll be wanting Match Margin.

For Visual Studio 2022 Match Margin is also available.

Solution 2 - .Net

Right now, the only way I know (without installing new extensions) is to select (double click) the word and hit ctrl-f (find). Scroll map should highlight all occurences (mine are orange)

Solution 3 - .Net

There's another extension which does exactly this, with options to customize colors and more. it called Word Highlight With Margin.

The extension created by Trung Kien Phan

Screenshots

https://i.stack.imgur.com/MlWId.jpg" width="450" /> https://i.stack.imgur.com/soBb7.png" width="340" /> https://i.stack.imgur.com/zSrDW.png" width="300" />

VS2017/VS2019 Version

Download link from Visual Studio market place - VS2017, VS2019

Previous versions:

VS2015

VS2010, VS2012, VS2013

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionToFoView Question on Stackoverflow
Solution 1 - .NetRichardView Answer on Stackoverflow
Solution 2 - .NetTomasz SzalkowskiView Answer on Stackoverflow
Solution 3 - .NetitshoView Answer on Stackoverflow