Skip to content

Commit e7a79c3

Browse files
committed
Rename code fixer project to CommunityToolkit.Mvvm.CodeFixers
1 parent 1be2fa1 commit e7a79c3

File tree

7 files changed

+24
-24
lines changed

7 files changed

+24
-24
lines changed

dotnet Community Toolkit.sln

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CommunityToolkit.Mvvm.Exter
8181
EndProject
8282
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CommunityToolkit.Mvvm.ExternalAssembly.Roslyn431", "tests\CommunityToolkit.Mvvm.ExternalAssembly.Roslyn431\CommunityToolkit.Mvvm.ExternalAssembly.Roslyn431.csproj", "{4FCD501C-1BB5-465C-AD19-356DAB6600C6}"
8383
EndProject
84-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CommunityToolkit.Mvvm.Fixers", "src\CommunityToolkit.Mvvm.Fixers\CommunityToolkit.Mvvm.Fixers.csproj", "{E79DCA2A-4C59-499F-85BD-F45215ED6B72}"
84+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CommunityToolkit.Mvvm.CodeFixers", "src\CommunityToolkit.Mvvm.CodeFixers\CommunityToolkit.Mvvm.CodeFixers.csproj", "{E79DCA2A-4C59-499F-85BD-F45215ED6B72}"
8585
EndProject
8686
Global
8787
GlobalSection(SolutionConfigurationPlatforms) = preSolution

src/CommunityToolkit.Mvvm.Fixers/FieldReferenceForObservablePropertyFieldFixer.cs renamed to src/CommunityToolkit.Mvvm.CodeFixers/FieldReferenceForObservablePropertyFieldFixer.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@
1515
using Microsoft.CodeAnalysis.CSharp.Syntax;
1616
using Microsoft.CodeAnalysis.Text;
1717

18-
namespace CommunityToolkit.Mvvm.Fixers;
18+
namespace CommunityToolkit.Mvvm.CodeFixers;
1919

2020
/// <summary>
2121
/// A code fixer that automatically updates references to fields with <c>[ObservableProperty]</c> to reference the generated property instead.
2222
/// </summary>
2323
[ExportCodeFixProvider(LanguageNames.CSharp)]
2424
[Shared]
25-
public sealed class FieldReferenceForObservablePropertyFieldFixer : CodeFixProvider
25+
public sealed class FieldReferenceForObservablePropertyFieldCodeFixer : CodeFixProvider
2626
{
2727
/// <inheritdoc/>
2828
public override ImmutableArray<string> FixableDiagnosticIds { get; } = ImmutableArray.Create(DiagnosticDescriptors.FieldReferenceForObservablePropertyFieldId);

src/CommunityToolkit.Mvvm.SourceGenerators/CommunityToolkit.Mvvm.SourceGenerators.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737

3838
<!-- Give access to the code fixers project for the exported diagnostic ids and properties -->
3939
<ItemGroup>
40-
<InternalsVisibleTo Include="CommunityToolkit.Mvvm.Fixers, PublicKey=$(AssemblySignPublicKey)" />
40+
<InternalsVisibleTo Include="CommunityToolkit.Mvvm.CodeFixers, PublicKey=$(AssemblySignPublicKey)" />
4141
</ItemGroup>
4242

4343
</Project>

src/CommunityToolkit.Mvvm/CommunityToolkit.Mvvm.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
3939
<ProjectReference Include="..\CommunityToolkit.Mvvm.SourceGenerators.Roslyn401\CommunityToolkit.Mvvm.SourceGenerators.Roslyn401.csproj" ReferenceOutputAssembly="false" />
4040
<ProjectReference Include="..\CommunityToolkit.Mvvm.SourceGenerators.Roslyn431\CommunityToolkit.Mvvm.SourceGenerators.Roslyn431.csproj" ReferenceOutputAssembly="false" />
41-
<ProjectReference Include="..\CommunityToolkit.Mvvm.Fixers\CommunityToolkit.Mvvm.Fixers.csproj" ReferenceOutputAssembly="false" />
41+
<ProjectReference Include="..\CommunityToolkit.Mvvm.CodeFixers\CommunityToolkit.Mvvm.CodeFixers.csproj" ReferenceOutputAssembly="false" />
4242
</ItemGroup>
4343

4444
<!-- Add the [InternalsVisibleTo] attribute for the test project -->
@@ -83,8 +83,8 @@
8383
-->
8484
<None Include="..\CommunityToolkit.Mvvm.SourceGenerators.Roslyn401\bin\$(Configuration)\netstandard2.0\CommunityToolkit.Mvvm.SourceGenerators.dll" PackagePath="analyzers\dotnet\roslyn4.0\cs" Pack="true" Visible="false" />
8585
<None Include="..\CommunityToolkit.Mvvm.SourceGenerators.Roslyn431\bin\$(Configuration)\netstandard2.0\CommunityToolkit.Mvvm.SourceGenerators.dll" PackagePath="analyzers\dotnet\roslyn4.3\cs" Pack="true" Visible="false" />
86-
<None Include="..\CommunityToolkit.Mvvm.Fixers\bin\$(Configuration)\netstandard2.0\CommunityToolkit.Mvvm.Fixers.dll" PackagePath="analyzers\dotnet\roslyn4.0\cs" Pack="true" Visible="false" />
87-
<None Include="..\CommunityToolkit.Mvvm.Fixers\bin\$(Configuration)\netstandard2.0\CommunityToolkit.Mvvm.Fixers.dll" PackagePath="analyzers\dotnet\roslyn4.3\cs" Pack="true" Visible="false" />
86+
<None Include="..\CommunityToolkit.Mvvm.CodeFixers\bin\$(Configuration)\netstandard2.0\CommunityToolkit.Mvvm.CodeFixers.dll" PackagePath="analyzers\dotnet\roslyn4.0\cs" Pack="true" Visible="false" />
87+
<None Include="..\CommunityToolkit.Mvvm.CodeFixers\bin\$(Configuration)\netstandard2.0\CommunityToolkit.Mvvm.CodeFixers.dll" PackagePath="analyzers\dotnet\roslyn4.3\cs" Pack="true" Visible="false" />
8888
</ItemGroup>
8989

9090
</Project>

tests/CommunityToolkit.Mvvm.SourceGenerators.Roslyn401.UnitTests/CommunityToolkit.Mvvm.SourceGenerators.Roslyn401.UnitTests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
<ItemGroup>
1818
<ProjectReference Include="..\..\src\CommunityToolkit.Mvvm\CommunityToolkit.Mvvm.csproj" />
19-
<ProjectReference Include="..\..\src\CommunityToolkit.Mvvm.Fixers\CommunityToolkit.Mvvm.Fixers.csproj" />
19+
<ProjectReference Include="..\..\src\CommunityToolkit.Mvvm.CodeFixers\CommunityToolkit.Mvvm.CodeFixers.csproj" />
2020
<ProjectReference Include="..\..\src\CommunityToolkit.Mvvm.SourceGenerators.Roslyn401\CommunityToolkit.Mvvm.SourceGenerators.Roslyn401.csproj" />
2121
</ItemGroup>
2222

tests/CommunityToolkit.Mvvm.SourceGenerators.Roslyn401.UnitTests/Test_FieldReferenceForObservablePropertyFieldFixer.cs

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,19 @@
66
using CommunityToolkit.Mvvm.ComponentModel;
77
using Microsoft.CodeAnalysis.Testing;
88
using Microsoft.VisualStudio.TestTools.UnitTesting;
9-
using Test = Microsoft.CodeAnalysis.CSharp.Testing.CSharpCodeFixTest<
9+
using CSharpCodeFixTest = Microsoft.CodeAnalysis.CSharp.Testing.CSharpCodeFixTest<
1010
CommunityToolkit.Mvvm.SourceGenerators.FieldReferenceForObservablePropertyFieldAnalyzer,
11-
CommunityToolkit.Mvvm.Fixers.FieldReferenceForObservablePropertyFieldFixer,
11+
CommunityToolkit.Mvvm.CodeFixers.FieldReferenceForObservablePropertyFieldCodeFixer,
1212
Microsoft.CodeAnalysis.Testing.Verifiers.MSTestVerifier>;
13-
using VerifyCS = Microsoft.CodeAnalysis.CSharp.Testing.CSharpCodeFixVerifier<
13+
using CSharpCodeFixVerifier = Microsoft.CodeAnalysis.CSharp.Testing.CSharpCodeFixVerifier<
1414
CommunityToolkit.Mvvm.SourceGenerators.FieldReferenceForObservablePropertyFieldAnalyzer,
15-
CommunityToolkit.Mvvm.Fixers.FieldReferenceForObservablePropertyFieldFixer,
15+
CommunityToolkit.Mvvm.CodeFixers.FieldReferenceForObservablePropertyFieldCodeFixer,
1616
Microsoft.CodeAnalysis.Testing.Verifiers.MSTestVerifier>;
1717

1818
namespace CommunityToolkit.Mvvm.SourceGenerators.Roslyn401.UnitTests;
1919

2020
[TestClass]
21-
public class Test_FieldReferenceForObservablePropertyFieldFixer
21+
public class Test_FieldReferenceForObservablePropertyFieldCodeFixer
2222
{
2323
[TestMethod]
2424
public async Task SimpleMemberAccess()
@@ -55,7 +55,7 @@ void M()
5555
}
5656
""";
5757

58-
Test test = new()
58+
CSharpCodeFixTest test = new()
5959
{
6060
TestCode = original,
6161
FixedCode = @fixed,
@@ -66,10 +66,10 @@ void M()
6666
test.ExpectedDiagnostics.AddRange(new[]
6767
{
6868
// /0/Test0.cs(10,13): warning MVVMTK0034: The field C.i is annotated with [ObservableProperty] and should not be directly referenced (use the generated property instead)
69-
VerifyCS.Diagnostic().WithSpan(10, 13, 10, 14).WithArguments("C.i"),
69+
CSharpCodeFixVerifier.Diagnostic().WithSpan(10, 13, 10, 14).WithArguments("C.i"),
7070

7171
// /0/Test0.cs(11,9): warning MVVMTK0034: The field C.i is annotated with [ObservableProperty] and should not be directly referenced (use the generated property instead)
72-
VerifyCS.Diagnostic().WithSpan(11, 9, 11, 10).WithArguments("C.i")
72+
CSharpCodeFixVerifier.Diagnostic().WithSpan(11, 9, 11, 10).WithArguments("C.i")
7373
});
7474

7575
test.FixedState.ExpectedDiagnostics.AddRange(new[]
@@ -119,7 +119,7 @@ void M()
119119
}
120120
""";
121121

122-
Test test = new()
122+
CSharpCodeFixTest test = new()
123123
{
124124
TestCode = original,
125125
FixedCode = @fixed,
@@ -130,10 +130,10 @@ void M()
130130
test.ExpectedDiagnostics.AddRange(new[]
131131
{
132132
// /0/Test0.cs(10,13): warning MVVMTK0034: The field C.i is annotated with [ObservableProperty] and should not be directly referenced (use the generated property instead)
133-
VerifyCS.Diagnostic().WithSpan(10, 13, 10, 19).WithArguments("C.i"),
133+
CSharpCodeFixVerifier.Diagnostic().WithSpan(10, 13, 10, 19).WithArguments("C.i"),
134134

135135
// /0/Test0.cs(11,9): warning MVVMTK0034: The field C.i is annotated with [ObservableProperty] and should not be directly referenced (use the generated property instead)
136-
VerifyCS.Diagnostic().WithSpan(11, 9, 11, 15).WithArguments("C.i"),
136+
CSharpCodeFixVerifier.Diagnostic().WithSpan(11, 9, 11, 15).WithArguments("C.i"),
137137
});
138138

139139
test.FixedState.ExpectedDiagnostics.AddRange(new[]
@@ -191,7 +191,7 @@ void M()
191191
}
192192
""";
193193

194-
Test test = new()
194+
CSharpCodeFixTest test = new()
195195
{
196196
TestCode = original,
197197
FixedCode = @fixed,
@@ -202,10 +202,10 @@ void M()
202202
test.ExpectedDiagnostics.AddRange(new[]
203203
{
204204
// /0/Test0.cs(14,9): warning MVVMTK0034: The field C.i is annotated with [ObservableProperty] and should not be directly referenced (use the generated property instead)
205-
VerifyCS.Diagnostic().WithSpan(14, 9, 14, 12).WithArguments("C.i"),
205+
CSharpCodeFixVerifier.Diagnostic().WithSpan(14, 9, 14, 12).WithArguments("C.i"),
206206

207207
// /0/Test0.cs(15,13): warning MVVMTK0034: The field C.i is annotated with [ObservableProperty] and should not be directly referenced (use the generated property instead)
208-
VerifyCS.Diagnostic().WithSpan(15, 13, 15, 16).WithArguments("C.i"),
208+
CSharpCodeFixVerifier.Diagnostic().WithSpan(15, 13, 15, 16).WithArguments("C.i"),
209209
});
210210

211211
test.FixedState.ExpectedDiagnostics.AddRange(new[]
@@ -261,7 +261,7 @@ void M()
261261
}
262262
""";
263263

264-
Test test = new()
264+
CSharpCodeFixTest test = new()
265265
{
266266
TestCode = original,
267267
FixedCode = @fixed,
@@ -272,7 +272,7 @@ void M()
272272
test.ExpectedDiagnostics.AddRange(new[]
273273
{
274274
// /0/Test0.cs(14,15): warning MVVMTK0034: The field C.i is annotated with [ObservableProperty] and should not be directly referenced (use the generated property instead)
275-
VerifyCS.Diagnostic().WithSpan(14, 15, 14, 17).WithArguments("C.i"),
275+
CSharpCodeFixVerifier.Diagnostic().WithSpan(14, 15, 14, 17).WithArguments("C.i"),
276276
});
277277

278278
test.FixedState.ExpectedDiagnostics.AddRange(new[]

0 commit comments

Comments
 (0)