These mark the end of CompoundStmts bodies of if/while/for/switch.
To identify which statement is being ended, we include abbreviated
text of the condition/loop variable.
Looks like this:
Paths
| Differential D155421
[clangd] Add BlockEnd comments for control flow statements ClosedPublic Authored by sammccall on Jul 16 2023, 11:13 PM.
Details Summary
Diff Detail
Event TimelineComment Actions Thanks, this looks like in a good shape. I left comments with some thoughts and nits, but they're not blockers, feel free to land it.
This revision is now accepted and ready to land.Jul 21 2023, 12:14 AM sammccall added inline comments.
This revision was landed with ongoing or failed builds.Jul 21 2023, 1:57 PM Closed by commit rGee032bccc934: [clangd] Add BlockEnd comments for control flow statements (authored by sammccall). · Explain Why This revision was automatically updated to reflect the committed changes. sammccall marked an inline comment as done.
Revision Contents
Diff 540868 clang-tools-extra/clangd/InlayHints.cpp
clang-tools-extra/clangd/unittests/InlayHintTests.cpp
|
This looks like a complicated implementation to get an abbreviated-form of cond expression for the inlay label text.
A different idea would be if the user can just click the inlay label text, then the editor jumps to the corresponding for statement (looks like it is supported with the InlayHintLabelPart::Location) with that we probably don't need to emit an abbreviated-form text (// for should be clear enough).