Skip to content

Commit 6038662

Browse files
[Azure Mgmt Generator] Fix XML documentation line breaks for resource providers (Azure#51917)
* Initial plan * Initial assessment of XML documentation line break issue Co-authored-by: ArcturusZhang <[email protected]> * Fix XML documentation line breaks in management generator providers Co-authored-by: ArcturusZhang <[email protected]> * Update MockableResourceProvider description to requested format Co-authored-by: ArcturusZhang <[email protected]> --------- Co-authored-by: Copilot <[email protected]> Co-authored-by: ArcturusZhang <[email protected]>
1 parent d9b042a commit 6038662

File tree

15 files changed

+49
-13
lines changed

15 files changed

+49
-13
lines changed

eng/packages/http-client-csharp-mgmt/eng/scripts/Generate.ps1

100644100755
File mode changed.

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
using Microsoft.TypeSpec.Generator.Primitives;
1515
using Microsoft.TypeSpec.Generator.Providers;
1616
using Microsoft.TypeSpec.Generator.Statements;
17+
using System;
1718
using System.Collections.Generic;
1819
using System.IO;
1920
using System.Linq;
@@ -111,6 +112,8 @@ private static Dictionary<InputClient, RestClientInfo> BuildRestClientInfos(
111112

112113
protected override string BuildName() => $"Mockable{ManagementClientGenerator.Instance.TypeFactory.ResourceProviderName}{ArmCoreType.Name}";
113114

115+
protected override FormattableString BuildDescription() => $"A class to add extension methods to {ArmCoreType:C}.";
116+
114117
protected override string BuildRelativeFilePath() => Path.Combine("src", "Generated", "Extensions", $"{Name}.cs");
115118

116119
protected override CSharpType? BuildBaseType() => typeof(ArmResource);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ private ResourceClientProvider(string resourceName, InputModelType model, IReadO
8787
protected override string BuildName() => ResourceName.EndsWith("Resource") ? ResourceName : $"{ResourceName}Resource";
8888

8989
// TODO: Add support for getting parent resource from a resource
90-
protected override FormattableString BuildDescription() => $"A class representing a {ResourceName} along with the instance operations that can be performed on it. If you have a {typeof(ResourceIdentifier):C} you can construct a {Type:C} from an instance of {typeof(ArmClient):C} using the GetResource method. Otherwise you can get one from its parent resource (TODO: add parent resource information).";
90+
protected override FormattableString BuildDescription() => $"A class representing a {ResourceName} along with the instance operations that can be performed on it.\nIf you have a {typeof(ResourceIdentifier):C} you can construct a {Type:C} from an instance of {typeof(ArmClient):C} using the GetResource method.\nOtherwise you can get one from its parent resource (TODO: add parent resource information).";
9191

9292
private OperationSourceProvider? _source;
9393
internal OperationSourceProvider Source => _source ??= new OperationSourceProvider(this);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ private static void InitializeMethods(
111111
protected override string BuildName() => $"{ResourceName}Collection";
112112

113113
// TODO: Add support for getting parent resource from a resource collection
114-
protected override FormattableString BuildDescription() => $"A class representing a collection of {_resource.Type:C} and their operations. Each {_resource.Type:C} in the collection will belong to the same instance of a parent resource (TODO: add parent resource information). To get a {Type:C} instance call the Get{ResourceName.Pluralize()} method from an instance of the parent resource.";
114+
protected override FormattableString BuildDescription() => $"A class representing a collection of {_resource.Type:C} and their operations.\nEach {_resource.Type:C} in the collection will belong to the same instance of a parent resource (TODO: add parent resource information).\nTo get a {Type:C} instance call the Get{ResourceName.Pluralize()} method from an instance of the parent resource.";
115115

116116
protected override string BuildRelativeFilePath() => Path.Combine("src", "Generated", $"{Name}.cs");
117117

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

Lines changed: 5 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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

Lines changed: 5 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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

Lines changed: 5 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)