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 formatting issues around for loops #648

Closed
elachlan opened this issue Aug 10, 2022 · 2 comments · Fixed by #656
Closed

Fix formatting issues around for loops #648

elachlan opened this issue Aug 10, 2022 · 2 comments · Fixed by #656
Assignees
Labels
bug Something isn't working

Comments

@elachlan
Copy link
Contributor

Actual behavior

Code generated with for loops seem to be indented and formatted incorrectly.

Expected behavior

Code should be generated with correctly formatted for loops.

Repro steps

  1. NativeMethods.txt content:
PAINTSTRUCT
  1. NativeMethods.json content (if present):
  1. Any of your own code that should be shared?

Issue is in WhitespaceRewriter.

image

Context

  • CsWin32 version: [e.g. 0.4.422-beta]
  • Win32Metadata version (if explicitly set by project):
  • Target Framework: [e.g. netstandard2.0]
  • LangVersion (if explicitly set by project): [e.g. 9]
@elachlan elachlan added the bug Something isn't working label Aug 10, 2022
@elachlan
Copy link
Contributor Author

In the example screenshot, is there supposed to be braces, or is this a single line?

@AArnott
Copy link
Member

AArnott commented Aug 10, 2022

No braces are generated in the syntax tree because it was only one statement. But if it makes it easier to fix, I have no objection with you adding braces around the statement in the syntax tree.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants