generated from dailydevops/dotnet-template
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Closed
Labels
type:featureIndicates a new feature or enhancement to be added.Indicates a new feature or enhancement to be added.
Description
Feature Request
Add a method to work with scopes that automatically handles indentation. When a scope is opened, the code is indented, and when the scope is closed, the indentation is reversed.
Example Usage
using (builder.Scope())
{
builder.AppendLine("return true;");
}
Benefits
- Simplifies code indentation management
- Ensures proper indentation when generating code blocks
- Reduces the chance of incorrect indentation in generated code
- Improves readability of the generated code builder usage
Implementation Notes
- Should be available as an extension method or directly on the CodeBuilderBase
- Should implement IDisposable for use with the 'using' statement
- Should handle the indentation increment on creation and decrement on disposal
Related Files
CodeBuilderBase.cs
CSharpCodeBuilder.cs
Copilot
Metadata
Metadata
Assignees
Labels
type:featureIndicates a new feature or enhancement to be added.Indicates a new feature or enhancement to be added.