Open Apflkuacha opened 2 years ago
Same issue, it also happens in visual studio 2019.
It took almost a week before we realized this... Some of our repos now need to be manually cleaned and this really sucks.
Thanks for reporting the issue. It looks like a number of issues are cropping up around inserting explicit access modifiers on properties and the underlying API is no longer behaving the way it used to before. At this point I would recommend turning off that option at CodeMaid->Options->Cleaning->Insert->Insert explicit access modifiers on->properties
@nbelley That does really suck, and I'm very sorry to hear it. :(
Off topic: why is there a separate 2022 Version of CodeMaid in the Visual Studio Marketplace? It was ranked that high in the default "Most Downloads" sort order, now it begins again with zero downloads?!
VS2022 included some breaking changes and required all extension authors to split their extensions. The recommendation was to create separate pages in the marketplace for each version. Here's a couple links with more information:
https://www.codemaid.net/codemaid-v12-0-a-fork-in-the-road-edition-released/ https://docs.microsoft.com/en-us/visualstudio/extensibility/migration/update-visual-studio-extension?view=vs-2022
This lookup is not coming back with the expected results: https://github.com/codecadwallader/codemaid/blob/dev/CodeMaidShared/Logic/Cleaning/InsertExplicitAccessModifierLogic.cs#L297
Since it isn't matching the property declaration correctly, it thinks the access modifier is missing and attempts to add it via the VS API. While it should(tm) not be attempting to do that it should(tm) also be harmless.
When we set the access modifier via the API it is introducing the new line. This is happening in both VS2019 and VS2022 although it did not use to do so with the same API call.
Environment
Description
With the new version, when the setting Insert explicit access modifiers on properties is activated, following line
is changed to
This line should stay in one line. It stays in one line if the setting mentioned above is deactivated. Following line for example will stay in one line, independent of the setting:
Off topic: why is there a separate 2022 Version of CodeMaid in the Visual Studio Marketplace? It was ranked that high in the default "Most Downloads" sort order, now it begins again with zero downloads?!