New install of Visual Studio 2022 – NET 6 project.
In the past, the variables (in the pic below) would have little squiggles underneath them and when I hover the mouse over them a suggestion would pop up stating something similar to (names are not cased or capitalized correctly). It was like the IDE had a code analyzer (maybe an extension/addon) that constantly monitored coding styles.
After installing VS 2022 I cannot figure out how to make these types of suggestions appear. Can anyone help me with this?
Edit – Additional info
I think, maybe it’s rule IDE1006
that I am trying to activate in the IDE
Also, in (Tools)(Options) I have these settings. But not a single notification about variable names that violate IDE1006
I can see all of these notifications too (pic below), so, I know with certainty the code is being analyzed (the analysis is just not pointing out (variable name) violations)
3
Answers
I edited my
.editorconfig
file (added the lines below), and now the Style Rules, specifically (IDE1006 naming rule violation), etc are enabled/flagged in my source codeIn addition to catching flat out syntax errors, Visual Studio does have code analyzers.
This feature still works. Looking at your image, it appears there are those dotted lines under
offet_A
andoffetBecause
. It’s hard to know exactly why because I don’t have enough context of the few lines we’re looking at.I do know that method names starting with lower-case letter generally trigger this warning, but again, we can’t see if you have that going on either.
So my answer is this feature is still active. But it only happens for naming that violates accepted naming conventions.
There is a setting for enabling and disabling specific style guidance selections.
You will need to navigate to Tools/Options/Text Editor/C#/Code Style/General