[clang] [Sema] Add code completion for if constexpr and consteval (PR #124315)

Nathan Ridge via cfe-commits cfe-commits at lists.llvm.org
Sat Feb 22 22:35:38 PST 2025


HighCommander4 wrote:

If I'm understanding correctly, this patch only completes the keywords themselves.

SemaCodeComplete also has the ability to produce "snippets", for example [here](https://searchfox.org/llvm/rev/4e44bd027bf4e490380be770172994561616bd2d/clang/lib/Sema/SemaCodeComplete.cpp#2405-2420) is a snippet for `if` statements. In such a case, the inserted text is `if (condition) { statements }`, with `condition` and `statements` being marked as placeholders (in editors with snippet support, the cursor will jump to the placeholders to allow you to type over them).

What do you think about adding similar snippets for `if constexpr` and `if consteval`?

https://github.com/llvm/llvm-project/pull/124315


More information about the cfe-commits mailing list