Skip to content

Commit 90f7d02

Browse files
committed
[clang] Add code completion for #embed directive in C23 mode
1 parent 31180ba commit 90f7d02

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

clang/lib/Sema/SemaCodeComplete.cpp

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff 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 "header"
10213+
Builder.AddTypedTextChunk("embed");
10214+
Builder.AddChunk(CodeCompletionString::CK_HorizontalSpace);
10215+
Builder.AddTextChunk("\"");
10216+
Builder.AddPlaceholderChunk("header");
10217+
Builder.AddTextChunk("\"");
10218+
Results.AddResult(Builder.TakeString());
10219+
10220+
// #embed <header>
10221+
Builder.AddTypedTextChunk("embed");
10222+
Builder.AddChunk(CodeCompletionString::CK_HorizontalSpace);
10223+
Builder.AddTextChunk("<");
10224+
Builder.AddPlaceholderChunk("header");
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.

0 commit comments

Comments
 (0)