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

Top level statement support #37

Merged
merged 2 commits into from
Dec 18, 2022
Merged

Conversation

ssttgg
Copy link
Collaborator

@ssttgg ssttgg commented Dec 13, 2022

Fixes #4 - It's a slightly bigger PR than it had to be as I moved over to the IndentedTextWriter to avoid playing pass the parcel with the level counter quite so much - though officially it was to make unwinding the indention a bit easier.

I found the tests for this a bit tricky to setup - sadly it required a new project (as far as I could be bothered to push it) and I didn't think it was worth adding full coverage of all the equality cases so I just settled on a very basic set of types.

…t and migrate to a more stateful output buffer mechanism to reduce the amount of things being passed around.
sb.AppendLine($"namespace {namespaceName}");
sb.AppendOpenBracket(ref level);

if (!string.IsNullOrEmpty(namespaceName))
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Refactoing aside, this is the crux of the fix.

@diegofrata diegofrata merged commit cf185f8 into diegofrata:main Dec 18, 2022
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.

Support C# 9 top-level statements
2 participants