dotnet/roslyn
Auf GitHub ansehenFormatting fixer doesn't fix formatting diagnostic
Open
#72.534 geöffnet am 13. März 2024
Area-IDEBugFeature - Collection Expressionshelp wanted
Repository-Metriken
- Stars
- (20.414 Stars)
- PR-Merge-Metriken
- (Durchschn. Merge 6T 17h) (256 gemergte PRs in 30 T)
Beschreibung
Considering the following sample:
class C
{
void M()
{
string[] x = [
"""
string
""",
"""
string
"""];
}
}
A formatting diagnostic is produced following the comma inside the collection expression:
When invoking the format fixer, nothing happens. When previewing the formatting fix, an empty box is displayed:
I still question the choice to produce that diagnostic, given that raw string literals are not prescriptive about whether to indent and some people (like myself) prefer to left indent them for clarity.
But regardless of that design question, I would expect the fixer to be able to fix formatting issues that are reported.