Skip to content

Commit 9e0fed8

Browse files
authored
Removed workaround for debugging source generators (#1155)
* Removed workaround for dotnet/roslyn#55802. The bug has been fixed in VS 2022 v17.2. * Package updates (in non-breaking fashion)
1 parent bba90e5 commit 9e0fed8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+13
-771
lines changed

Diff for: Directory.Build.props

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<AspNetVersion>6.0.*</AspNetVersion>
55
<EFCoreVersion>6.0.*</EFCoreVersion>
66
<EFCorePostgresVersion>6.0.*</EFCorePostgresVersion>
7-
<MicrosoftCodeAnalysisVersion>4.1.*</MicrosoftCodeAnalysisVersion>
7+
<MicrosoftCodeAnalysisVersion>4.2.*</MicrosoftCodeAnalysisVersion>
88
<HumanizerVersion>2.14.1</HumanizerVersion>
99
<JsonApiDotNetCoreVersionPrefix>5.0.2</JsonApiDotNetCoreVersionPrefix>
1010
<CodeAnalysisRuleSet>$(MSBuildThisFileDirectory)CodingGuidelines.ruleset</CodeAnalysisRuleSet>
@@ -34,7 +34,7 @@
3434
<!-- Test Project Dependencies -->
3535
<PropertyGroup>
3636
<CoverletVersion>3.1.2</CoverletVersion>
37-
<MoqVersion>4.17.2</MoqVersion>
38-
<TestSdkVersion>17.1.0</TestSdkVersion>
37+
<MoqVersion>4.18.1</MoqVersion>
38+
<TestSdkVersion>17.2.0</TestSdkVersion>
3939
</PropertyGroup>
4040
</Project>

Diff for: JsonApiDotNetCore.sln

-15
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestBuildingBlocks", "test\
4646
EndProject
4747
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "JsonApiDotNetCore.SourceGenerators", "src\JsonApiDotNetCore.SourceGenerators\JsonApiDotNetCore.SourceGenerators.csproj", "{952C0FDE-AFC8-455C-986F-6CC882ED8953}"
4848
EndProject
49-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SourceGeneratorDebugger", "test\SourceGeneratorDebugger\SourceGeneratorDebugger.csproj", "{87D066F9-3540-4AC7-A748-134900969EE5}"
50-
EndProject
5149
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SourceGeneratorTests", "test\SourceGeneratorTests\SourceGeneratorTests.csproj", "{0E0B5C51-F7E2-4F40-A4E4-DED0E9731DC9}"
5250
EndProject
5351
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "JsonApiDotNetCore.Annotations", "src\JsonApiDotNetCore.Annotations\JsonApiDotNetCore.Annotations.csproj", "{83FF097C-C8C6-477B-9FAB-DF99B84978B5}"
@@ -232,18 +230,6 @@ Global
232230
{952C0FDE-AFC8-455C-986F-6CC882ED8953}.Release|x64.Build.0 = Release|Any CPU
233231
{952C0FDE-AFC8-455C-986F-6CC882ED8953}.Release|x86.ActiveCfg = Release|Any CPU
234232
{952C0FDE-AFC8-455C-986F-6CC882ED8953}.Release|x86.Build.0 = Release|Any CPU
235-
{87D066F9-3540-4AC7-A748-134900969EE5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
236-
{87D066F9-3540-4AC7-A748-134900969EE5}.Debug|Any CPU.Build.0 = Debug|Any CPU
237-
{87D066F9-3540-4AC7-A748-134900969EE5}.Debug|x64.ActiveCfg = Debug|Any CPU
238-
{87D066F9-3540-4AC7-A748-134900969EE5}.Debug|x64.Build.0 = Debug|Any CPU
239-
{87D066F9-3540-4AC7-A748-134900969EE5}.Debug|x86.ActiveCfg = Debug|Any CPU
240-
{87D066F9-3540-4AC7-A748-134900969EE5}.Debug|x86.Build.0 = Debug|Any CPU
241-
{87D066F9-3540-4AC7-A748-134900969EE5}.Release|Any CPU.ActiveCfg = Release|Any CPU
242-
{87D066F9-3540-4AC7-A748-134900969EE5}.Release|Any CPU.Build.0 = Release|Any CPU
243-
{87D066F9-3540-4AC7-A748-134900969EE5}.Release|x64.ActiveCfg = Release|Any CPU
244-
{87D066F9-3540-4AC7-A748-134900969EE5}.Release|x64.Build.0 = Release|Any CPU
245-
{87D066F9-3540-4AC7-A748-134900969EE5}.Release|x86.ActiveCfg = Release|Any CPU
246-
{87D066F9-3540-4AC7-A748-134900969EE5}.Release|x86.Build.0 = Release|Any CPU
247233
{0E0B5C51-F7E2-4F40-A4E4-DED0E9731DC9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
248234
{0E0B5C51-F7E2-4F40-A4E4-DED0E9731DC9}.Debug|Any CPU.Build.0 = Debug|Any CPU
249235
{0E0B5C51-F7E2-4F40-A4E4-DED0E9731DC9}.Debug|x64.ActiveCfg = Debug|Any CPU
@@ -299,7 +285,6 @@ Global
299285
{EC3202C6-1D4C-4B14-A599-B9D3F27FE3BA} = {24B15015-62E5-42E1-9BA0-ECE6BE7AA15F}
300286
{210FD61E-FF5D-4CEE-8E0D-C739ECCCBA21} = {24B15015-62E5-42E1-9BA0-ECE6BE7AA15F}
301287
{952C0FDE-AFC8-455C-986F-6CC882ED8953} = {7A2B7ADD-ECB5-4D00-AA6A-D45BD11C97CF}
302-
{87D066F9-3540-4AC7-A748-134900969EE5} = {24B15015-62E5-42E1-9BA0-ECE6BE7AA15F}
303288
{0E0B5C51-F7E2-4F40-A4E4-DED0E9731DC9} = {24B15015-62E5-42E1-9BA0-ECE6BE7AA15F}
304289
{83FF097C-C8C6-477B-9FAB-DF99B84978B5} = {7A2B7ADD-ECB5-4D00-AA6A-D45BD11C97CF}
305290
{60334658-BE51-43B3-9C4D-F2BBF56C89CE} = {026FBC6C-AF76-4568-9B87-EC73457899FD}

Diff for: src/JsonApiDotNetCore.Annotations/Resources/Annotations/ResourceAttribute.cs

-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
using JetBrains.Annotations;
22
using JsonApiDotNetCore.Controllers;
33

4-
// ReSharper disable CheckNamespace
5-
#pragma warning disable AV1505 // Namespace should match with assembly name
6-
74
namespace JsonApiDotNetCore.Resources.Annotations;
85

96
/// <summary>

Diff for: src/JsonApiDotNetCore.SourceGenerators/ControllerSourceGenerator.cs

+6
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@
1313

1414
namespace JsonApiDotNetCore.SourceGenerators
1515
{
16+
// To debug in Visual Studio (requires v17.2 or higher):
17+
// - Set JsonApiDotNetCore.SourceGenerators as startup project
18+
// - Add a breakpoint at the start of the Initialize or Execute method
19+
// - Optional: change targetProject in Properties\launchSettings.json
20+
// - Press F5
21+
1622
[Generator(LanguageNames.CSharp)]
1723
public sealed class ControllerSourceGenerator : ISourceGenerator
1824
{

Diff for: src/JsonApiDotNetCore.SourceGenerators/JsonApiDotNetCore.SourceGenerators.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,6 @@
4848

4949
<ItemGroup>
5050
<PackageReference Include="Humanizer.Core" Version="$(HumanizerVersion)" PrivateAssets="all" GeneratePathProperty="true" />
51-
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="$(MicrosoftCodeAnalysisVersion)" PrivateAssets="all" />
51+
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.1.0" PrivateAssets="all" />
5252
</ItemGroup>
5353
</Project>

Diff for: src/JsonApiDotNetCore.SourceGenerators/Properties/launchSettings.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"profiles": {
33
"JsonApiDotNetCore.SourceGenerators": {
44
"commandName": "DebugRoslynComponent",
5-
"targetProject": "..\\..\\test\\SourceGeneratorDebugger\\SourceGeneratorDebugger.csproj"
5+
"targetProject": "..\\Examples\\JsonApiDotNetCoreExample\\JsonApiDotNetCoreExample.csproj"
66
}
77
}
88
}

Diff for: test/SourceGeneratorDebugger/Controllers/ArticlesController.cs

-16
This file was deleted.

Diff for: test/SourceGeneratorDebugger/Controllers/CustomersController.cs

-18
This file was deleted.

Diff for: test/SourceGeneratorDebugger/JsonApiDotNetCore/ArgumentGuard.cs

-19
This file was deleted.

Diff for: test/SourceGeneratorDebugger/JsonApiDotNetCore/AttrAttribute.cs

-15
This file was deleted.

Diff for: test/SourceGeneratorDebugger/JsonApiDotNetCore/BaseJsonApiController.cs

-41
This file was deleted.

Diff for: test/SourceGeneratorDebugger/JsonApiDotNetCore/IAddToRelationshipService.cs

-18
This file was deleted.

Diff for: test/SourceGeneratorDebugger/JsonApiDotNetCore/ICreateService.cs

-18
This file was deleted.

Diff for: test/SourceGeneratorDebugger/JsonApiDotNetCore/IDeleteService.cs

-18
This file was deleted.

Diff for: test/SourceGeneratorDebugger/JsonApiDotNetCore/IGetAllService.cs

-18
This file was deleted.

Diff for: test/SourceGeneratorDebugger/JsonApiDotNetCore/IGetByIdService.cs

-18
This file was deleted.

Diff for: test/SourceGeneratorDebugger/JsonApiDotNetCore/IGetRelationshipService.cs

-18
This file was deleted.

Diff for: test/SourceGeneratorDebugger/JsonApiDotNetCore/IGetSecondaryService.cs

-18
This file was deleted.

Diff for: test/SourceGeneratorDebugger/JsonApiDotNetCore/IIdentifiable.cs

-23
This file was deleted.

Diff for: test/SourceGeneratorDebugger/JsonApiDotNetCore/IJsonApiOptions.cs

-15
This file was deleted.

0 commit comments

Comments
 (0)