How to get Visual Studio 2010 to highlight instances of a variable

后端 未结 10 1880
梦谈多话
梦谈多话 2021-02-03 21:28

I\'m new using vs2010 I\'ve read that when you click on a variable its suppose to highlight all the instances of that variable in that file and highlight red or show an error as

10条回答
  •  说谎
    说谎 (楼主)
    2021-02-03 22:06

    I came here from google while looking to do the same thing with Visual Studio 2017 community edition. The answers above point out you can turn this on for VB and C#. The option does not exist for C or C++. ie. for C/C++ the option does not exist in advanced settings so you can not right click the variable and select highlight variable.

    However, I learned its simpler for C/C++ to get the equivalent behaviour. Simply double click the variable/function to select it. The editor will highlight all instances of the variable or function in the file. Its not limited by blocks. Its highlighted in the entire file.

提交回复
热议问题