Skip to content

Commit

Permalink
ensure the IScenarioBuilder types can be recognized
Browse files Browse the repository at this point in the history
  • Loading branch information
dresswithpockets committed Nov 29, 2021
1 parent ffc01a1 commit c54d4f9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/Scenario.SourceGenerator/Scenario.SourceGenerator.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<Nullable>enable</Nullable>
<AssemblyVersion>0.2.0</AssemblyVersion>
<AssemblyVersion>0.2.1</AssemblyVersion>
<PackageId>Scenario.SourceGenerator</PackageId>
<Version>0.2.0</Version>
<Version>0.2.1</Version>
<Authors>dresswithpockets</Authors>
<Description>Source generators to improve the Scenario workflow.</Description>
<PackageProjectUrl>https://dresswithpockets.github.io/Scenario</PackageProjectUrl>
Expand Down
8 changes: 4 additions & 4 deletions src/Scenario.SourceGenerator/SourceGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -166,13 +166,13 @@ private string GenerateMethodSource(DependencyMethodInfo methodInfo, INamedTypeS
{
var body = $@"
public static __TScenarioBuilder {extensionName}<__TScenarioBuilder{typeParams}>(this __TScenarioBuilder __scenarioBuilder{@params})
where __TScenarioBuilder : IScenarioBuilder{typeConstraints}
where __TScenarioBuilder : global::Scenario.IScenarioBuilder{typeConstraints}
=> (__TScenarioBuilder) __scenarioBuilder.With(__scope => {method.ContainingType.Name}.{method.Name}{funcCallTypeParams}(__scope{paramInjection}));
";
if (generateNonGenericForm ?? false)
{
body += $@"
public static IScenarioBuilder {extensionName}{funcCallTypeParams}(this IScenarioBuilder __scenarioBuilder{@params}){typeConstraints}
public static global::Scenario.IScenarioBuilder {extensionName}{funcCallTypeParams}(this global::Scenario.IScenarioBuilder __scenarioBuilder{@params}){typeConstraints}
=> __scenarioBuilder.With(__scope => {method.ContainingType.Name}.{method.Name}{funcCallTypeParams}(__scope{paramInjection}));
";
}
Expand All @@ -183,13 +183,13 @@ private string GenerateMethodSource(DependencyMethodInfo methodInfo, INamedTypeS
{
var body = $@"
public static __TScenarioBuilder {extensionName}<__TScenarioBuilder{typeParams}>(this __TScenarioBuilder __scenarioBuilder{@params})
where __TScenarioBuilder : IScenarioBuilder{typeConstraints}
where __TScenarioBuilder : global::Scenario.IScenarioBuilder{typeConstraints}
=> (__TScenarioBuilder) __scenarioBuilder.Use(__services => {method.ContainingType.Name}.{method.Name}{funcCallTypeParams}(__services{paramInjection}));
";
if (generateNonGenericForm ?? false)
{
body += $@"
public static IScenarioBuilder {extensionName}{funcCallTypeParams}(this IScenarioBuilder __scenarioBuilder{@params}){typeConstraints}
public static global::Scenario.IScenarioBuilder {extensionName}{funcCallTypeParams}(this global::Scenario.IScenarioBuilder __scenarioBuilder{@params}){typeConstraints}
=> __scenarioBuilder.Use(__services => {method.ContainingType.Name}.{method.Name}{funcCallTypeParams}(__services{paramInjection}));
";
}
Expand Down

0 comments on commit c54d4f9

Please sign in to comment.