From f70699a6fcfd80e126b7ca28eaf52cb0e2ded495 Mon Sep 17 00:00:00 2001 From: Rintaro Ishizaki Date: Mon, 9 May 2022 15:30:33 -0700 Subject: [PATCH] [CodeCompletion] _compilerInitialized and _local are UserInaccessible These declaration modifiers are not meant to be used from user source code. Mark them 'UserInaccessible' so code completion don't show them. rdar://92970201 (cherry picked from commit 9f3bc0e85b6a7e8d13926c81d5fd9fba43cc02cb) --- include/swift/AST/Attr.def | 2 ++ .../complete_override.swift.response | 20 ------------------- 2 files changed, 2 insertions(+), 20 deletions(-) diff --git a/include/swift/AST/Attr.def b/include/swift/AST/Attr.def index 516b6dd0f8ef8..ba8bc61e1696c 100644 --- a/include/swift/AST/Attr.def +++ b/include/swift/AST/Attr.def @@ -267,6 +267,7 @@ SIMPLE_DECL_ATTR(objcMembers, ObjCMembers, 34) CONTEXTUAL_SIMPLE_DECL_ATTR(_compilerInitialized, CompilerInitialized, OnVar | + UserInaccessible | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, 35) CONTEXTUAL_SIMPLE_DECL_ATTR(__consuming, Consuming, @@ -726,6 +727,7 @@ DECL_ATTR(_backDeploy, BackDeploy, CONTEXTUAL_SIMPLE_DECL_ATTR(_local, KnownToBeLocal, DeclModifier | OnFunc | OnParam | OnVar | + UserInaccessible | ABIBreakingToAdd | ABIBreakingToRemove | APIBreakingToAdd | APIBreakingToRemove, 130) diff --git a/test/SourceKit/CodeComplete/complete_override.swift.response b/test/SourceKit/CodeComplete/complete_override.swift.response index 2e4fee6763ef7..95cb2db88c8be 100644 --- a/test/SourceKit/CodeComplete/complete_override.swift.response +++ b/test/SourceKit/CodeComplete/complete_override.swift.response @@ -1,15 +1,5 @@ { key.results: [ - { - key.kind: source.lang.swift.keyword, - key.name: "_compilerInitialized", - key.sourcetext: "_compilerInitialized", - key.description: "_compilerInitialized", - key.typename: "", - key.context: source.codecompletion.context.none, - key.typerelation: source.codecompletion.typerelation.notapplicable, - key.num_bytes_to_erase: 0 - }, { key.kind: source.lang.swift.keyword, key.name: "_const", @@ -20,16 +10,6 @@ key.typerelation: source.codecompletion.typerelation.notapplicable, key.num_bytes_to_erase: 0 }, - { - key.kind: source.lang.swift.keyword, - key.name: "_local", - key.sourcetext: "_local", - key.description: "_local", - key.typename: "", - key.context: source.codecompletion.context.none, - key.typerelation: source.codecompletion.typerelation.notapplicable, - key.num_bytes_to_erase: 0 - }, { key.kind: source.lang.swift.keyword, key.name: "actor",