Open SpaceOgre opened 1 year ago
It looks like insert explicit modifiers will reformat braces even when the modifier isn't changed 🤷.
You can turn this off via: Code maid-> Options-> Cleaning-> Insert-> Insert explicit access modifier fields on properties
@TimothyMakkison this does indeed work, but I would like if I could keep that feature to 😞
Yeah it's super annoying, I think this "bug" affects any type that enables insert explicit access modifiers and will insert a new line even when the access modifier isn't changed.
internal struct TempS { }
// Becomes
internal struct TempS
{ }
I'm guessing the new line insertion is caused by changing the access modifier via the api codemaid uses. I don't understand why it always updates the type (adding a new line) even when it has an access modifier, I suspect the check is broken.
var propertyDeclaration = CodeElementHelper.GetPropertyDeclaration(codeProperty);
if (!IsAccessModifierExplicitlySpecifiedOnCodeElement(propertyDeclaration, codeProperty.Access))
{
// Set the access value to itself to cause the code to be added.
codeProperty.Access = codeProperty.Access;
}
Hopefully #980 is added and fixes this 🤞
Thanks both for all of the details. Yes there is a known issue in the VS SDK introduced in VS2022, more details in #879.
Environment
Description
I have an older codebase and there are a lot of get only properties that looks like this:
When I choose to clean document with CodeMaid it is changed to
If I just format the document using Visual Studios built in
Format document
this does not happen so it seems to be a CodeMaid thing. I have tried changing the different settings but can't find the one to change, is it possible to change this behavior?It is the same if it has a
set
to.