Skip to content

Commit df698d2

Browse files
committed
Remove __consuming from CodeCompletion
Set the UserInaccessible bit to remove __consuming from code completion until we commit to a real keyword. rdar://40828289
1 parent 47b93ab commit df698d2

File tree

3 files changed

+6
-9
lines changed

3 files changed

+6
-9
lines changed

include/swift/AST/Attr.def

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,7 @@ SIMPLE_DECL_ATTR(objcMembers, ObjCMembers,
226226
CONTEXTUAL_SIMPLE_DECL_ATTR(__consuming, Consuming,
227227
OnFunc | OnAccessor |
228228
DeclModifier |
229+
UserInaccessible |
229230
NotSerialized, 40)
230231
CONTEXTUAL_SIMPLE_DECL_ATTR(mutating, Mutating,
231232
OnFunc | OnAccessor |

lib/IDE/CodeCompletion.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4845,6 +4845,11 @@ static void addDeclKeywords(CodeCompletionResultSink &Sink) {
48454845
// Treat keywords that could be the start of a pattern specially.
48464846
return;
48474847
}
4848+
// FIXME: __consuming should not appear in CodeCompletion until it is
4849+
// finalized in a language proposal.
4850+
if (Name == "__consuming")
4851+
return;
4852+
48484853
CodeCompletionResultBuilder Builder(
48494854
Sink, CodeCompletionResult::ResultKind::Keyword,
48504855
SemanticContextKind::None, {});

test/SourceKit/CodeComplete/complete_override.swift.response

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,5 @@
11
{
22
key.results: [
3-
{
4-
key.kind: source.lang.swift.keyword,
5-
key.name: "__consuming",
6-
key.sourcetext: "__consuming",
7-
key.description: "__consuming",
8-
key.typename: "",
9-
key.context: source.codecompletion.context.none,
10-
key.num_bytes_to_erase: 0
11-
},
123
{
134
key.kind: source.lang.swift.keyword,
145
key.name: "associatedtype",

0 commit comments

Comments
 (0)