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

2025-03-07 Thread Letu Ren via cfe-commits
https://github.com/FantasqueX updated https://github.com/llvm/llvm-project/pull/124315 >From f186c52e78c26db93cc37d858d088259cd3029a1 Mon Sep 17 00:00:00 2001 From: Letu Ren Date: Sat, 25 Jan 2025 01:23:52 +0800 Subject: [PATCH 01/10] [Sema] Add code completion for if constexpr C++17 supports

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

2025-03-07 Thread Younan Zhang via cfe-commits
@@ -6749,6 +6749,55 @@ void SemaCodeCompletion::CodeCompleteInitializer(Scope *S, Decl *D) { CodeCompleteExpression(S, Data); } +void SemaCodeCompletion::CodeCompleteIfConst(Scope *S, + bool AfterExclaim) const {

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

2025-03-07 Thread Younan Zhang via cfe-commits
@@ -6749,6 +6749,21 @@ void SemaCodeCompletion::CodeCompleteInitializer(Scope *S, Decl *D) { CodeCompleteExpression(S, Data); } +void SemaCodeCompletion::CodeCompleteIfConstExpr(Scope *S) const { + ResultBuilder Results(SemaRef, CodeCompleter->getAllocator(), +

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

2025-03-07 Thread Younan Zhang via cfe-commits
@@ -6749,6 +6749,55 @@ void SemaCodeCompletion::CodeCompleteInitializer(Scope *S, Decl *D) { CodeCompleteExpression(S, Data); } +void SemaCodeCompletion::CodeCompleteIfConst(Scope *S, + bool AfterExclaim) const { + ResultBuilder

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

2025-02-24 Thread Letu Ren via cfe-commits
https://github.com/FantasqueX updated https://github.com/llvm/llvm-project/pull/124315 >From ad4784ab47b65e478f669c6ef4b30008c76c5f0b Mon Sep 17 00:00:00 2001 From: Letu Ren Date: Sat, 25 Jan 2025 01:23:52 +0800 Subject: [PATCH 1/9] [Sema] Add code completion for if constexpr C++17 supports `i

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

2025-02-24 Thread via cfe-commits
@@ -0,0 +1,6 @@ +void test() { + if c cor3ntin wrote: can you add a test for `if !` ? https://github.com/llvm/llvm-project/pull/124315 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi

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

2025-02-23 Thread Letu Ren via cfe-commits
https://github.com/FantasqueX updated https://github.com/llvm/llvm-project/pull/124315 >From 576dcfa4a403b95665e98f9ff225ab5353192e23 Mon Sep 17 00:00:00 2001 From: Letu Ren Date: Sat, 25 Jan 2025 01:23:52 +0800 Subject: [PATCH 1/7] [Sema] Add code completion for if constexpr C++17 supports `i

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

2025-02-23 Thread Letu Ren via cfe-commits
FantasqueX wrote: Hi @HighCommander4 thanks for your suggestions. I'm happy to add snippets support for `if constexpr` and `if consteval`. Since `if constexp` and `if !consteval` is valid, I decided to add code snippet completion in the specific code completion function instead of in

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

2025-02-23 Thread via cfe-commits
github-actions[bot] wrote: :warning: C/C++ code formatter, clang-format found issues in your code. :warning: You can test this locally with the following command: ``bash git-clang-format --diff 9d1fbbd2b9a00248eb8ea578c4047af4ec4da990 914e63cbc8ac24c808da647fe9516e1d10866c87 --e

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

2025-02-23 Thread Letu Ren via cfe-commits
https://github.com/FantasqueX updated https://github.com/llvm/llvm-project/pull/124315 >From 576dcfa4a403b95665e98f9ff225ab5353192e23 Mon Sep 17 00:00:00 2001 From: Letu Ren Date: Sat, 25 Jan 2025 01:23:52 +0800 Subject: [PATCH 1/6] [Sema] Add code completion for if constexpr C++17 supports `i

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

2025-02-22 Thread Nathan Ridge via cfe-commits
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#2

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

2025-02-17 Thread Letu Ren via cfe-commits
https://github.com/FantasqueX edited https://github.com/llvm/llvm-project/pull/124315 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2025-02-17 Thread Letu Ren via cfe-commits
https://github.com/FantasqueX edited https://github.com/llvm/llvm-project/pull/124315 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits