-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
Clang-format: Have an option to add a comment at the closing brace of a loop, switch, case etc #124741
Labels
Comments
@llvm/issue-subscribers-clang-format Author: None (MrMfromK)
There is an option to add a comment giving the name of a namespace at the closing brace of a namespace (FixNamespaceComments).
My wish is to have something similiar at the closing brace of loops, switch, case, if, else showing the respective instrution at the opening brace.
Maybe with a minimal number of lines between opening and closing brace and a seperate option for each of the mentioned instructions.
Would be great help!
|
What would it say? The namespace comment makes sense, since the namespace has an identifier, and therefore carries more semantic information with it, but the utility of a comment that says "endfor or similar" is less obvious for (...) {
for (...) {
for (...) {
} // endfor?
} // endfor?
} //endfor? |
Hi Luke,
thanks for asking for clrification.
I’ld like something like this:
for (n=0, n<5; n++) {
.. some code ..
while (something == false) {
.. some more code ..
if (n > 2) {
..a lot of code..
} // if (n > 2)
..
} // while (something == false)
..
} // for (n=0, n<5; n++)
I often don’t find it clear what is the condition at the opening braces when only seeing the closing brace. Often I use a key shortcut to jump to the opening brace and back again. Or I copy the instruction manually.
I hope you like this idea.
Von: Luke Drummond ***@***.***>
Gesendet: Dienstag, 28. Januar 2025 15:31
An: llvm/llvm-project ***@***.***>
Cc: MENSCH, Martin - RACE RESULT ***@***.***>; Author ***@***.***>
Betreff: Re: [llvm/llvm-project] Clang-format: Have an option to add a comment at the closing brace of a loop, switch, case etc (Issue #124741)
EXTERNAL MAIL
What would it say? The namespace comment makes sense, since the namespace has an identifier, and therefore carries more semantic information with it, but the utility of a comment that says "endfor or similar" is less obvious
for (...) {
for (...) {
for (...) {
} // endfor?
} // endfor?
} //endfor?
—
Reply to this email directly, view it on GitHub<#124741 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AXYZAHLVKK6MXWON5NCED5T2M6IDXAVCNFSM6AAAAABWAPDPRGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMMJZGE3DOMJZGQ>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
[RACE RESULT Precision. Passion. German Engineering.]
race result AG
Joseph-von-Fraunhofer-Straße 11
D-76327 Pfinztal, Germany
www.raceresult.com<http://www.raceresult.com>
CEO: Sönke Petersen
Chairman of Supervisory Board: Johannes Maier
Local Court of Mannheim: HRB 717 610
Internet Email Confidentiality Footer
Privileged/Confidential Information may be contained in this message. If you are not the addressee indicated in this message (or responsible for delivery of the message to such person), you may not copy or deliver this message to anyone. In such case, you should destroy this message and kindly notify the sender by reply email. Please advise immediately if you or your employer does not consent to Internet email for messages of this kind. Opinions, conclusions and other information in this message that do not relate to the official business of my firm shall be understood as neither given nor endorsed by it.
|
EugeneZelenko
added
the
enhancement
Improving things as opposed to bug fixing, e.g. new or missing feature
label
Jan 28, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
There is an option to add a comment giving the name of a namespace at the closing brace of a namespace (FixNamespaceComments).
My wish is to have something similiar at the closing brace of loops, switch, case, if, else showing the respective instrution at the opening brace.
Maybe with a minimal number of lines between opening and closing brace and a seperate option for each of the mentioned instructions.
Would be great help!
The text was updated successfully, but these errors were encountered: