Skip to content

Commit f1bab2d

Browse files
authored
Filter out ClientBuilderExtensionsDefinition for MPG (#50971)
1 parent 7e5e2a5 commit f1bab2d

File tree

3 files changed

+23
-16
lines changed

3 files changed

+23
-16
lines changed

eng/packages/http-client-csharp-mgmt/generator/Azure.Generator.Management/src/ManagementClientGenerator.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ protected override void Configure()
5353
AddVisitor(new ResourceVisitor());
5454
AddVisitor(new InheritableSystemObjectModelVisitor());
5555
AddVisitor(new NameVisitor());
56+
AddVisitor(new TypeFilterVisiter());
5657
}
5758
}
5859
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License.
3+
4+
using Microsoft.TypeSpec.Generator.ClientModel;
5+
using Microsoft.TypeSpec.Generator.Providers;
6+
7+
namespace Azure.Generator.Management
8+
{
9+
internal class TypeFilterVisiter : ScmLibraryVisitor
10+
{
11+
/// <inheritdoc/>
12+
protected override TypeProvider? VisitType(TypeProvider type)
13+
{
14+
// This visitor is used to filter types, so we return null to remove the type from the output.
15+
if (type is not null && type.Name.EndsWith("ClientBuilderExtensions"))
16+
{
17+
return null;
18+
}
19+
return type;
20+
}
21+
}
22+
}

eng/packages/http-client-csharp-mgmt/generator/TestProjects/Local/Mgmt-TypeSpec/src/Generated/MgmtTypeSpecClientBuilderExtensions.cs

Lines changed: 0 additions & 16 deletions
This file was deleted.

0 commit comments

Comments
 (0)