Skip to content

Conversation

@praveenkuttappan
Copy link
Member

Samples restructure to follow the pattern used by language service.

@praveenkuttappan praveenkuttappan self-assigned this Nov 18, 2025
@praveenkuttappan praveenkuttappan added the DevEx Agent Developer experience agent work label Nov 18, 2025
Copilot AI review requested due to automatic review settings November 18, 2025 20:01
@praveenkuttappan praveenkuttappan requested a review from a team as a code owner November 18, 2025 20:01
Copilot finished reviewing on behalf of praveenkuttappan November 18, 2025 20:03
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR restructures the sample generation architecture to consolidate sample-related code within the language services directory and eliminates the language-specific resolver pattern. The changes simplify the dependency injection model by making SampleLanguageContext a property directly accessible from each LanguageService instead of requiring resolution through a separate service.

  • Moved all sample generation classes from Azure.Sdk.Tools.Cli.Samples to Azure.Sdk.Tools.Cli.Services.Languages.Samples.SampleGeneration namespace
  • Removed the ILanguageSpecificResolver<T> and its implementation, eliminating dynamic language detection logic
  • Added SampleLanguageContext as a property on LanguageService base class, instantiated via a switch expression
  • Updated all LanguageService implementations to accept IFileHelper in their constructors

Reviewed Changes

Copilot reviewed 42 out of 42 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
SampleTranslatorTool.cs Removed dependency on ILanguageSpecificResolver, now accesses SampleLanguageContext directly from language services
SampleGeneratorTool.cs Removed dependency on ILanguageSpecificResolver, simplified constructor
ServiceRegistrations.cs Removed registration of language-specific resolver for SampleLanguageContext
LanguageService.cs Added SampleLanguageContext property with factory pattern and IFileHelper field
*LanguageService.cs (all languages) Updated constructors to accept IFileHelper parameter
SampleGeneration/*.cs Namespace changed from Azure.Sdk.Tools.Cli.Samples to Azure.Sdk.Tools.Cli.Services.Languages.Samples.SampleGeneration
SampleConstants.cs Namespace updated to match new location
LanguageSpecificResolver.cs File deleted - resolver pattern removed
ILanguageSpecificResolver.cs File deleted - interface removed
LanguageSpecificExtensions.cs File deleted - extension methods for resolver removed
Test files Updated to pass IFileHelper mock to all LanguageService constructors, removed resolver mocking
Comments suppressed due to low confidence (4)

tools/azsdk-cli/Azure.Sdk.Tools.Cli/Services/Languages/Samples/SampleGeneration/GoSourceInputProvider.cs:6

  • Duplicate copyright headers detected. Lines 1-3 contain a copyright header, and lines 4-6 duplicate it. Remove the duplicate lines 4-6.
    tools/azsdk-cli/Azure.Sdk.Tools.Cli/Services/Languages/Samples/SampleGeneration/GoSampleLanguageContext.cs:6
  • Duplicate copyright headers detected. Lines 1-3 contain a copyright header, and lines 4-6 duplicate it. Remove the duplicate lines 4-6.
    tools/azsdk-cli/Azure.Sdk.Tools.Cli/Services/Languages/Samples/SampleGeneration/DotNetSampleLanguageContext.cs:6
  • Duplicate copyright headers detected. Lines 1-3 contain a copyright header, and lines 4-6 duplicate it. Remove the duplicate lines 4-6.
    tools/azsdk-cli/Azure.Sdk.Tools.Cli/Services/Languages/Samples/SampleGeneration/ILanguageSourceInputProvider.cs:6
  • Duplicate copyright headers detected. Lines 1-3 contain a copyright header, and lines 4-6 duplicate it. Remove the duplicate lines 4-6.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

DevEx Agent Developer experience agent work

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants