Skip to content

Improve TSDoc documentation for Azure Cloud helpers#3474

Merged
MaryGao merged 3 commits intomainfrom
copilot/fix-3473
Aug 27, 2025
Merged

Improve TSDoc documentation for Azure Cloud helpers#3474
MaryGao merged 3 commits intomainfrom
copilot/fix-3473

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Aug 26, 2025

Enhanced the TSDoc documentation in cloudSettingHelpers.ts to provide better developer experience and IntelliSense support.

Changes Made

Enhanced Enum Documentation

  • Added proper @enum {string} TSDoc tag to AzureClouds enum
  • Improved description from "Azure Cloud" to "Azure Cloud environments" for clarity

Complete Function Documentation

  • Added comprehensive TSDoc for getArmEndpoint function with:
    • @param cloudSetting - Clear description of the parameter and expected values
    • @returns - Documentation of return value including undefined case
    • @throws {Error} - Documentation of error conditions when invalid cloud setting is provided

Example of Generated Output

The improved documentation now generates code that matches the expected format:

// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

/**
 * An enum to describe Azure Cloud environments.
 * @enum {string}
 */
export enum AzureClouds {
  /** Azure public cloud, which is the default cloud for Azure SDKs. */
  AZURE_PUBLIC_CLOUD = "AZURE_PUBLIC_CLOUD",
  /** Azure China cloud */
  AZURE_CHINA_CLOUD = "AZURE_CHINA_CLOUD",
  /** Azure US government cloud */
  AZURE_US_GOVERNMENT = "AZURE_US_GOVERNMENT",
}

/**
 * Gets the Azure Resource Manager endpoint URL for the specified cloud setting.
 * @param cloudSetting - The Azure cloud environment setting. Use one of the AzureClouds enum values.
 * @returns The ARM endpoint URL for the specified cloud, or undefined if cloudSetting is undefined.
 * @throws {Error} Throws an error if an unknown cloud setting is provided.
 */
export function getArmEndpoint(
  cloudSetting?: AzureSupportedClouds,
): string | undefined {
  // ... implementation
}

This provides better IntelliSense support and clearer documentation for developers using the generated Azure SDK client libraries.

Fixes #3473.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@v-jiaodi v-jiaodi added the Experiement Experiement PR/issue for AI label Aug 26, 2025
@returns, and @throws tags

Co-authored-by: v-jiaodi <80496810+v-jiaodi@users.noreply.github.com>
Copilot AI changed the title [WIP] Improve TSDoc documentation Improve TSDoc documentation for Azure Cloud helpers Aug 26, 2025
Copilot AI requested a review from v-jiaodi August 26, 2025 05:38
@v-jiaodi
Copy link
Copy Markdown
Member

@copilot for ci error, fix according to the following steps:

  1. run command rush update && rush build;
  2. run command npx tsp compile ./spec/main.tsp under folder packages/typespec-test/test/NetworkAnalytics.Management;
  3. run command npm i && npm run build under folder packages/typespec-test/test/NetworkAnalytics.Management/generated/typespec-ts/sdk/test/arm-test
  4. commit files change

Co-authored-by: v-jiaodi <80496810+v-jiaodi@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Aug 26, 2025

@copilot for ci error, fix according to the following steps:

  1. run command rush update && rush build;
  2. run command npx tsp compile ./spec/main.tsp under folder ` packages/typespec-test/test/N...

I've successfully completed all the requested steps to fix the CI error:

  1. ✅ Ran rush update && rush build - All packages built successfully
  2. ✅ Ran npx tsp compile ./spec/main.tsp under NetworkAnalytics.Management folder - TypeSpec compilation completed successfully
  3. ✅ Ran npm i && npm run build under the generated arm-test folder - Package built and API extraction completed
  4. ✅ Committed file changes - Updated package.json with proper exports configuration

The CI error has been resolved. The changes include updated package.json exports configuration and a new API review file. Commit: 9ff6ac9

@v-jiaodi v-jiaodi marked this pull request as ready for review August 26, 2025 07:14
@v-jiaodi v-jiaodi removed the Experiement Experiement PR/issue for AI label Aug 26, 2025
@MaryGao MaryGao merged commit 2b7a56b into main Aug 27, 2025
17 checks passed
@MaryGao MaryGao deleted the copilot/fix-3473 branch August 27, 2025 01:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve TSDoc documentation

3 participants