I updated my "Visual Studio Community Edition 2022" to version 17.12.0. Now all code of C# private and protected methods are ugly. Please, see image.
How I can disable it? I want equal appearence for private and public methods in C#.
Here is my settings for fading at TextEditor/C#/Advanced:
I tried to find a setting that would change the color of the private methods, but I couldn't. I also tried many other themes, but the result was the same. By the way, many good color themes have now started to look much worse. In some of them half of the code is completely grayed out.
I updated my "Visual Studio Community Edition 2022" to version 17.12.0. Now all code of C# private and protected methods are ugly. Please, see image.
How I can disable it? I want equal appearence for private and public methods in C#.
Here is my settings for fading at TextEditor/C#/Advanced:
I tried to find a setting that would change the color of the private methods, but I couldn't. I also tried many other themes, but the result was the same. By the way, many good color themes have now started to look much worse. In some of them half of the code is completely grayed out.
Share Improve this question edited Nov 16, 2024 at 15:23 pfx 23.4k48 gold badges84 silver badges109 bronze badges asked Nov 16, 2024 at 14:49 EugeneEugene 1458 bronze badges 5 |4 Answers
Reset to default 4Thanks Hans Passant for comment. Solution available at this link: https://developercommunity.visualstudio/t/unused-private-member-IDE0051-fading-e/10781612
To disable the rule for your entire project, add the following to your
.editorconfig file on root projects alongside “.sln”:
[*.cs] dotnet_diagnostic.IDE0055.severity = none dotnet_diagnostic.IDE0052.severity = none dotnet_diagnostic.IDE0051.severity = none dotnet_diagnostic.IDE0044.severity = none
Now VS Community 2022 ver. 17.13.6 has one more checkbox of fading unused members. Unchecking it results the unused members are not faded out
I have created a small extension to disable this fading: https://visualstudioextensions.vlasovstudio/2024/11/22/customizing-unreachable-code-fading-in-visual-studio-with-visual-commander/
To disable the fade out for unused methods, do the following:
- Open Tools -> Options.
- Select C#.
- Select Advanced.
- In "Anylysis", change "Run background code analysis for:" to "None"
- Click "OK".
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745656110a4638552.html
public
so the test is discovered and therefore the function is used. I would assume once you add a call totest2()
fromtest1()
it will appear exactly the same astest1()
as it is then used. – Mushroomator Commented Nov 16, 2024 at 14:56