You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The codefixer for adding the UseCommunityToolkit call will reformat my code.
Expected Behavior
Keep my original indentations - this is especially important for a more complex set of code here that I don't want reformatted. The specific example below isn't super bad, but as this build expression grows and becomes more complex, this autofix gets very annoying. If I want VS to reformat, I'll just use the VS tooling explicitly.
Steps To Reproduce
Create a new .NET MAUI project
Add CommunityToolkit.Maui package reference
in MauiProgram.cs let the analyzer "fix" your code to add the .UseCommunityToolkit() call
Notice how it reformats your code and indents
Before:
After:
Environment
- .NET MAUI CommunityToolkit: 7.0.1
Anything else?
Issue is caused by the NormalizeWhitespace call here:
Is there an existing issue for this?
Did you read the "Reporting a bug" section on Contributing file?
Current Behavior
The codefixer for adding the UseCommunityToolkit call will reformat my code.
Expected Behavior
Keep my original indentations - this is especially important for a more complex set of code here that I don't want reformatted. The specific example below isn't super bad, but as this build expression grows and becomes more complex, this autofix gets very annoying. If I want VS to reformat, I'll just use the VS tooling explicitly.
Steps To Reproduce
.UseCommunityToolkit()
callBefore:


After:
Environment
- .NET MAUI CommunityToolkit: 7.0.1
Anything else?
Issue is caused by the
NormalizeWhitespace
call here:Maui/src/CommunityToolkit.Maui.Analyzers.CodeFixes/UseCommunityToolkitInitializationAnalyzerCodeFixProvider.cs
Line 66 in 739c843
You might also want to enhance your unit tests to test the code fixer. See my version of your analyzer with those tests added here: https://github.com/Esri/arcgis-maps-sdk-dotnet-toolkit/blob/19aea6002b41f539d6cbad0b5e533f3d2dc9c5c9/src/Analyzers/Toolkit.Maui.Analyzers.UnitTests/UseToolkitInitializationAnalyzerTests.cs#L75-L129
Note: There's a bug in xunit that makes this not work - I'm using MSTest which doesn't have this issue.
The text was updated successfully, but these errors were encountered: