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

Reduce some indenting in c++ generated code when printed block starts with #if #19765

Closed
wants to merge 1 commit into from

Conversation

copybara-service[bot]
Copy link

@copybara-service copybara-service bot commented Dec 20, 2024

Reduce some indenting in c++ generated code when printed block starts with #if

Similar to existing case here

//~ force indenting level

When there is an #if or #ifdef in raw strings, clang-format wants to put it at the start of the line, which can leave a big gap compared to the rest of the code, and throws off indent calculation.

Alternatively, special case the printer to look for such #if (then users don't need to remember this), but the printer is language independent.

… with `#if`

Similar to existing case here https://github.com/protocolbuffers/protobuf/blob/05af18d24bf607669e1b7dc07b5fe3558c311c16/src/google/protobuf/compiler/cpp/message.cc#L4645

When there is an #if or #ifdef in raw strings, clang-format wants to put it at the start of the line, which can leave a big gap compared to the rest of the code, and throws off indent calculation.

Alternatively, special case the printer to look for such #if (then users don't need to remember this), but the printer is language independent.

PiperOrigin-RevId: 708314949
@copybara-service copybara-service bot changed the title Internal change Reduce some indenting in c++ generated code when printed block starts with #if Dec 20, 2024
Copy link

Auto-closing Copybara pull request

@github-actions github-actions bot closed this Dec 27, 2024
@github-actions github-actions bot deleted the test_708314949 branch December 27, 2024 10:02
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