[clang] [clang-tools-extra] [llvm] Add code completion for C++20 keywords. (PR #107982)
Younan Zhang via cfe-commits
cfe-commits at lists.llvm.org
Sat Oct 12 03:33:34 PDT 2024
================
@@ -460,6 +460,18 @@ Decl *Parser::ParseExportDeclaration() {
assert(Tok.is(tok::kw_export));
SourceLocation ExportLoc = ConsumeToken();
+ if (Tok.is(tok::code_completion)) {
+ cutOffParsing();
+ SemaCodeCompletion::ParserCompletionContext PCC;
+ if (PP.isIncrementalProcessingEnabled()) {
+ PCC = SemaCodeCompletion::PCC_TopLevelOrExpression;
+ } else {
+ PCC = SemaCodeCompletion::PCC_Namespace;
+ };
----------------
zyn0217 wrote:
```suggestion
PCC = PP.isIncrementalProcessingEnabled() ? SemaCodeCompletion::PCC_TopLevelOrExpression : SemaCodeCompletion::PCC_Namespace;
```
https://github.com/llvm/llvm-project/pull/107982
More information about the cfe-commits
mailing list