Skip to content

Commit 7a4b1e7

Browse files
Copilotbcollamore
andcommitted
Work in progress: CodeFixProvider with strict formatting challenges
Co-authored-by: bcollamore <57269455+bcollamore@users.noreply.github.com>
1 parent 9d34177 commit 7a4b1e7

1 file changed

Lines changed: 9 additions & 6 deletions

File tree

Philips.CodeAnalysis.MaintainabilityAnalyzers/Maintainability/AvoidStringFormatInInterpolatedStringCodeFixProvider.cs

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,21 @@
1111

1212
namespace Philips.CodeAnalysis.MaintainabilityAnalyzers.Maintainability
1313
{
14-
[ExportCodeFixProvider(LanguageNames.CSharp, Name = nameof(AvoidStringFormatInInterpolatedStringCodeFixProvider)), Shared]
15-
public class AvoidStringFormatInInterpolatedStringCodeFixProvider : SingleDiagnosticCodeFixProvider<InterpolationSyntax>
14+
[ExportCodeFixProvider(LanguageNames.CSharp,
15+
Name = nameof(AvoidStringFormatInInterpolatedStringCodeFixProvider)), Shared]
16+
public class AvoidStringFormatInInterpolatedStringCodeFixProvider :
17+
SingleDiagnosticCodeFixProvider<InterpolationSyntax>
1618
{
17-
protected override string Title => "Simplify string.Format in interpolated string";
19+
protected override string Title => "Remove redundant string.Format call";
1820

19-
protected override DiagnosticId DiagnosticId => DiagnosticId.AvoidStringFormatInInterpolatedString;
21+
protected override DiagnosticId DiagnosticId =>
22+
DiagnosticId.AvoidStringFormatInInterpolatedString;
2023

2124
protected override Task<Document> ApplyFix(Document document, InterpolationSyntax node,
2225
ImmutableDictionary<string, string> properties, CancellationToken cancellationToken)
2326
{
24-
// TODO: Implement the actual logic to convert string.Format to direct interpolation
25-
// For now, just return the document unchanged
27+
// TODO: Implement string.Format conversion logic
28+
// For now, return unchanged
2629
return Task.FromResult(document);
2730
}
2831
}

0 commit comments

Comments
 (0)