Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add support for source generators
- Loading branch information
Showing
14 changed files
with
285 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
src/components/tbc.host/Components/SourceGeneratorResolver/ISourceGeneratorResolver.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
using Tbc.Host.Components.SourceGeneratorResolver.Models; | ||
|
||
namespace Tbc.Host.Components.SourceGeneratorResolver; | ||
|
||
public interface ISourceGeneratorResolver | ||
{ | ||
Task<ResolveSourceGeneratorsResponse> ResolveSourceGenerators(ResolveSourceGeneratorsRequest request, | ||
CancellationToken canceller = default); | ||
} |
3 changes: 3 additions & 0 deletions
3
src/components/tbc.host/Components/SourceGeneratorResolver/Models/PackageReference.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
namespace Tbc.Host.Components.SourceGeneratorResolver.Models; | ||
|
||
public record PackageReference(string Include, string Version); |
3 changes: 3 additions & 0 deletions
3
...ents/tbc.host/Components/SourceGeneratorResolver/Models/ResolveSourceGeneratorsRequest.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
namespace Tbc.Host.Components.SourceGeneratorResolver.Models; | ||
|
||
public record ResolveSourceGeneratorsRequest(SourceGeneratorReference Reference); |
11 changes: 11 additions & 0 deletions
11
...nts/tbc.host/Components/SourceGeneratorResolver/Models/ResolveSourceGeneratorsResponse.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
using System.Collections.Immutable; | ||
using Microsoft.CodeAnalysis; | ||
|
||
namespace Tbc.Host.Components.SourceGeneratorResolver.Models; | ||
|
||
public record ResolveSourceGeneratorsResponse( | ||
SourceGeneratorReference Reference, | ||
ImmutableList<ISourceGenerator> SourceGenerators, | ||
ImmutableList<IIncrementalGenerator> IncrementalGenerators, | ||
ImmutableDictionary<string, object> Diagnostics | ||
); |
3 changes: 3 additions & 0 deletions
3
...components/tbc.host/Components/SourceGeneratorResolver/Models/SourceGeneratorReference.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
namespace Tbc.Host.Components.SourceGeneratorResolver.Models; | ||
|
||
public record SourceGeneratorReference(SourceGeneratorReferenceKind Kind, string Reference, string? Context = null); |
3 changes: 3 additions & 0 deletions
3
...onents/tbc.host/Components/SourceGeneratorResolver/Models/SourceGeneratorReferenceKind.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
namespace Tbc.Host.Components.SourceGeneratorResolver.Models; | ||
|
||
public enum SourceGeneratorReferenceKind { AssemblyPath, NuGetPackageReference, Csproj } |
Oops, something went wrong.