File tree Expand file tree Collapse file tree 2 files changed +23
-0
lines changed Expand file tree Collapse file tree 2 files changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -10208,6 +10208,24 @@ void SemaCodeCompletion::CodeCompletePreprocessorDirective(bool InConditional) {
1020810208 Builder.AddPlaceholderChunk (" message" );
1020910209 Results.AddResult (Builder.TakeString ());
1021010210
10211+ if (getLangOpts ().C23 ) {
10212+ // #embed "file"
10213+ Builder.AddTypedTextChunk (" embed" );
10214+ Builder.AddChunk (CodeCompletionString::CK_HorizontalSpace);
10215+ Builder.AddTextChunk (" \" " );
10216+ Builder.AddPlaceholderChunk (" file" );
10217+ Builder.AddTextChunk (" \" " );
10218+ Results.AddResult (Builder.TakeString ());
10219+
10220+ // #embed <file>
10221+ Builder.AddTypedTextChunk (" embed" );
10222+ Builder.AddChunk (CodeCompletionString::CK_HorizontalSpace);
10223+ Builder.AddTextChunk (" <" );
10224+ Builder.AddPlaceholderChunk (" file" );
10225+ Builder.AddTextChunk (" >" );
10226+ Results.AddResult (Builder.TakeString ());
10227+ }
10228+
1021110229 // Note: #ident and #sccs are such crazy anachronisms that we don't provide
1021210230 // completions for them. And __include_macros is a Clang-internal extension
1021310231 // that we don't want to encourage anyone to use.
Original file line number Diff line number Diff line change 8080// RUN: env CINDEXTEST_EDITING=1 CINDEXTEST_COMPLETION_CACHING=1 c-index-test -code-completion-at=%s:9:8 %s | FileCheck -check-prefix=CHECK-CC3 %s
8181// RUN: env CINDEXTEST_EDITING=1 CINDEXTEST_COMPLETION_CACHING=1 c-index-test -code-completion-at=%s:11:5 %s | FileCheck -check-prefix=CHECK-CC4 %s
8282// RUN: env CINDEXTEST_EDITING=1 CINDEXTEST_COMPLETION_CACHING=1 c-index-test -code-completion-at=%s:14:5 %s | FileCheck -check-prefix=CHECK-CC5 %s
83+
84+ // Test #embed completion in C23 mode
85+ // RUN: c-index-test -code-completion-at=%s:4:2 %s -std=c23 | FileCheck -check-prefix=CHECK-EMBED %s
86+ // CHECK-EMBED: NotImplemented:{TypedText embed}{HorizontalSpace }{Text "}{Placeholder file}{Text "} (40)
87+ // CHECK-EMBED: NotImplemented:{TypedText embed}{HorizontalSpace }{Text <}{Placeholder file}{Text >} (40)
You can’t perform that action at this time.
0 commit comments