Skip to content

Commit

Permalink
Removed workaround for debugging source generators (#1155)
Browse files Browse the repository at this point in the history
* Removed workaround for dotnet/roslyn#55802. The bug has been fixed in VS 2022 v17.2.

* Package updates (in non-breaking fashion)
  • Loading branch information
nicolestandifer3 committed May 21, 2022
1 parent 071323f commit c74a2b8
Show file tree
Hide file tree
Showing 44 changed files with 13 additions and 771 deletions.
6 changes: 3 additions & 3 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<AspNetVersion>6.0.*</AspNetVersion>
<EFCoreVersion>6.0.*</EFCoreVersion>
<EFCorePostgresVersion>6.0.*</EFCorePostgresVersion>
<MicrosoftCodeAnalysisVersion>4.1.*</MicrosoftCodeAnalysisVersion>
<MicrosoftCodeAnalysisVersion>4.2.*</MicrosoftCodeAnalysisVersion>
<HumanizerVersion>2.14.1</HumanizerVersion>
<JsonApiDotNetCoreVersionPrefix>5.0.2</JsonApiDotNetCoreVersionPrefix>
<CodeAnalysisRuleSet>$(MSBuildThisFileDirectory)CodingGuidelines.ruleset</CodeAnalysisRuleSet>
Expand Down Expand Up @@ -34,7 +34,7 @@
<!-- Test Project Dependencies -->
<PropertyGroup>
<CoverletVersion>3.1.2</CoverletVersion>
<MoqVersion>4.17.2</MoqVersion>
<TestSdkVersion>17.1.0</TestSdkVersion>
<MoqVersion>4.18.1</MoqVersion>
<TestSdkVersion>17.2.0</TestSdkVersion>
</PropertyGroup>
</Project>
15 changes: 0 additions & 15 deletions JsonApiDotNetCore.sln
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestBuildingBlocks", "test\
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "JsonApiDotNetCore.SourceGenerators", "src\JsonApiDotNetCore.SourceGenerators\JsonApiDotNetCore.SourceGenerators.csproj", "{952C0FDE-AFC8-455C-986F-6CC882ED8953}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SourceGeneratorDebugger", "test\SourceGeneratorDebugger\SourceGeneratorDebugger.csproj", "{87D066F9-3540-4AC7-A748-134900969EE5}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SourceGeneratorTests", "test\SourceGeneratorTests\SourceGeneratorTests.csproj", "{0E0B5C51-F7E2-4F40-A4E4-DED0E9731DC9}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "JsonApiDotNetCore.Annotations", "src\JsonApiDotNetCore.Annotations\JsonApiDotNetCore.Annotations.csproj", "{83FF097C-C8C6-477B-9FAB-DF99B84978B5}"
Expand Down Expand Up @@ -232,18 +230,6 @@ Global
{952C0FDE-AFC8-455C-986F-6CC882ED8953}.Release|x64.Build.0 = Release|Any CPU
{952C0FDE-AFC8-455C-986F-6CC882ED8953}.Release|x86.ActiveCfg = Release|Any CPU
{952C0FDE-AFC8-455C-986F-6CC882ED8953}.Release|x86.Build.0 = Release|Any CPU
{87D066F9-3540-4AC7-A748-134900969EE5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{87D066F9-3540-4AC7-A748-134900969EE5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{87D066F9-3540-4AC7-A748-134900969EE5}.Debug|x64.ActiveCfg = Debug|Any CPU
{87D066F9-3540-4AC7-A748-134900969EE5}.Debug|x64.Build.0 = Debug|Any CPU
{87D066F9-3540-4AC7-A748-134900969EE5}.Debug|x86.ActiveCfg = Debug|Any CPU
{87D066F9-3540-4AC7-A748-134900969EE5}.Debug|x86.Build.0 = Debug|Any CPU
{87D066F9-3540-4AC7-A748-134900969EE5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{87D066F9-3540-4AC7-A748-134900969EE5}.Release|Any CPU.Build.0 = Release|Any CPU
{87D066F9-3540-4AC7-A748-134900969EE5}.Release|x64.ActiveCfg = Release|Any CPU
{87D066F9-3540-4AC7-A748-134900969EE5}.Release|x64.Build.0 = Release|Any CPU
{87D066F9-3540-4AC7-A748-134900969EE5}.Release|x86.ActiveCfg = Release|Any CPU
{87D066F9-3540-4AC7-A748-134900969EE5}.Release|x86.Build.0 = Release|Any CPU
{0E0B5C51-F7E2-4F40-A4E4-DED0E9731DC9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0E0B5C51-F7E2-4F40-A4E4-DED0E9731DC9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0E0B5C51-F7E2-4F40-A4E4-DED0E9731DC9}.Debug|x64.ActiveCfg = Debug|Any CPU
Expand Down Expand Up @@ -299,7 +285,6 @@ Global
{EC3202C6-1D4C-4B14-A599-B9D3F27FE3BA} = {24B15015-62E5-42E1-9BA0-ECE6BE7AA15F}
{210FD61E-FF5D-4CEE-8E0D-C739ECCCBA21} = {24B15015-62E5-42E1-9BA0-ECE6BE7AA15F}
{952C0FDE-AFC8-455C-986F-6CC882ED8953} = {7A2B7ADD-ECB5-4D00-AA6A-D45BD11C97CF}
{87D066F9-3540-4AC7-A748-134900969EE5} = {24B15015-62E5-42E1-9BA0-ECE6BE7AA15F}
{0E0B5C51-F7E2-4F40-A4E4-DED0E9731DC9} = {24B15015-62E5-42E1-9BA0-ECE6BE7AA15F}
{83FF097C-C8C6-477B-9FAB-DF99B84978B5} = {7A2B7ADD-ECB5-4D00-AA6A-D45BD11C97CF}
{60334658-BE51-43B3-9C4D-F2BBF56C89CE} = {026FBC6C-AF76-4568-9B87-EC73457899FD}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
using JetBrains.Annotations;
using JsonApiDotNetCore.Controllers;

// ReSharper disable CheckNamespace
#pragma warning disable AV1505 // Namespace should match with assembly name

namespace JsonApiDotNetCore.Resources.Annotations;

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@

namespace JsonApiDotNetCore.SourceGenerators
{
// To debug in Visual Studio (requires v17.2 or higher):
// - Set JsonApiDotNetCore.SourceGenerators as startup project
// - Add a breakpoint at the start of the Initialize or Execute method
// - Optional: change targetProject in Properties\launchSettings.json
// - Press F5

[Generator(LanguageNames.CSharp)]
public sealed class ControllerSourceGenerator : ISourceGenerator
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,6 @@

<ItemGroup>
<PackageReference Include="Humanizer.Core" Version="$(HumanizerVersion)" PrivateAssets="all" GeneratePathProperty="true" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="$(MicrosoftCodeAnalysisVersion)" PrivateAssets="all" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.1.0" PrivateAssets="all" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"profiles": {
"JsonApiDotNetCore.SourceGenerators": {
"commandName": "DebugRoslynComponent",
"targetProject": "..\\..\\test\\SourceGeneratorDebugger\\SourceGeneratorDebugger.csproj"
"targetProject": "..\\Examples\\JsonApiDotNetCoreExample\\JsonApiDotNetCoreExample.csproj"
}
}
}
16 changes: 0 additions & 16 deletions test/SourceGeneratorDebugger/Controllers/ArticlesController.cs

This file was deleted.

18 changes: 0 additions & 18 deletions test/SourceGeneratorDebugger/Controllers/CustomersController.cs

This file was deleted.

19 changes: 0 additions & 19 deletions test/SourceGeneratorDebugger/JsonApiDotNetCore/ArgumentGuard.cs

This file was deleted.

15 changes: 0 additions & 15 deletions test/SourceGeneratorDebugger/JsonApiDotNetCore/AttrAttribute.cs

This file was deleted.

This file was deleted.

This file was deleted.

18 changes: 0 additions & 18 deletions test/SourceGeneratorDebugger/JsonApiDotNetCore/ICreateService.cs

This file was deleted.

18 changes: 0 additions & 18 deletions test/SourceGeneratorDebugger/JsonApiDotNetCore/IDeleteService.cs

This file was deleted.

18 changes: 0 additions & 18 deletions test/SourceGeneratorDebugger/JsonApiDotNetCore/IGetAllService.cs

This file was deleted.

18 changes: 0 additions & 18 deletions test/SourceGeneratorDebugger/JsonApiDotNetCore/IGetByIdService.cs

This file was deleted.

This file was deleted.

This file was deleted.

23 changes: 0 additions & 23 deletions test/SourceGeneratorDebugger/JsonApiDotNetCore/IIdentifiable.cs

This file was deleted.

15 changes: 0 additions & 15 deletions test/SourceGeneratorDebugger/JsonApiDotNetCore/IJsonApiOptions.cs

This file was deleted.

Loading

0 comments on commit c74a2b8

Please sign in to comment.