Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: implemented change to always use __ as prefix and suffix for parameter names generated for a LambdaFunction. #1984

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

ashishdhingra
Copy link
Contributor

@ashishdhingra ashishdhingra commented Feb 17, 2025

Issue #, if available: #1977

Description of changes:
Implemented change to always use __ as prefix and suffix for parameter names generated for a LambdaFunction.

Debugging Steps:
Referred article https://nicksnettravels.builttoroam.com/debug-code-gen/ to debug the project (needed to understand the code flow for source generator):

  • Added below reference of Amazon.Lambda.Annotations.SourceGenerator project in the target application project:
    <ItemGroup>
      <ProjectReference 
    		Include="..\aws-lambda-dotnet\Libraries\src\Amazon.Lambda.Annotations.SourceGenerator.csproj"
    		OutputItemType="Analyzer"
    		ReferenceOutputAssembly="false" />
    </ItemGroup>
  • Uncommented the below code in Generator constructor:
    #if DEBUG
      if (!Debugger.IsAttached)
      {
          Debugger.Launch();
      }
    #endif 

We would need to clean solution, close Visual Studio, reload project solution. It would prompt to select Visual Studio instance for debugging. If selecting current instance, it would have dialog looking for change in source files as Generator() constructor is debugged.
Thereafter, set breakpoint in Execute() method and expand Dependencies > Analyzers > Amazon.Lambda.Annotations.SourceGenerator. It will try to inspect target application project and execute source generator logic.

This PR also includes the following changes:

  • Executed command autover change --project-name "Amazon.Lambda.Annotations" -m "fix: implemented change to always use __ as prefix and suffix for parameter names generated for a LambdaFunction." to create the change file using ONLY Amazon.Lambda.Annotations project. Per @normj, there is a single NuGet package with the both Amazon.Lambda.Annotations.dll for runtime and Amazon.Lambda.Annotaitons.SourceGenerator.dll run by the Roslyn compiler. The csproj file for Amazon.Lambda.Annotations.SourceGenerator. Refer existing commit.

  • Updated integration test snapshots which would be changed as a result of this change.

  • Updated existing test to include the above scenario.


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@ashishdhingra ashishdhingra force-pushed the user/ashdhin/Annotations-DOTNET-7984 branch 4 times, most recently from 3dba807 to 8bdf7fc Compare February 18, 2025 21:24
…arameter names generated for a LambdaFunction.
@ashishdhingra ashishdhingra force-pushed the user/ashdhin/Annotations-DOTNET-7984 branch from 8bdf7fc to 33d4991 Compare February 19, 2025 05:13
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.

1 participant