mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Merge pull request #7140 from rintaro/codecomplete-override-protocol
[CodeComplete] Don't emit 'override' in protocol extension
This commit is contained in:
@@ -4140,8 +4140,9 @@ public:
|
||||
|
||||
// FIXME: if we're missing 'override', but have the decl introducer we
|
||||
// should delete it and re-add both in the correct order.
|
||||
bool missingOverride = Reason == DeclVisibilityKind::MemberOfSuper &&
|
||||
!hasOverride;
|
||||
bool missingOverride =
|
||||
!hasOverride && Reason == DeclVisibilityKind::MemberOfSuper &&
|
||||
!CurrDeclContext->getAsProtocolOrProtocolExtensionContext();
|
||||
if (!hasDeclIntroducer && missingOverride)
|
||||
Builder.addOverrideKeyword();
|
||||
|
||||
@@ -4193,6 +4194,7 @@ public:
|
||||
addAccessControl(CD, Builder);
|
||||
|
||||
if (!hasOverride && Reason == DeclVisibilityKind::MemberOfSuper &&
|
||||
!CurrDeclContext->getAsProtocolOrProtocolExtensionContext() &&
|
||||
CD->isDesignatedInit() && !CD->isRequired())
|
||||
Builder.addOverrideKeyword();
|
||||
|
||||
@@ -4334,6 +4336,8 @@ public:
|
||||
void getOverrideCompletions(SourceLoc Loc) {
|
||||
if (!CurrDeclContext->getAsNominalTypeOrNominalTypeExtensionContext())
|
||||
return;
|
||||
if (isa<ProtocolDecl>(CurrDeclContext))
|
||||
return;
|
||||
|
||||
Type CurrTy = CurrDeclContext->getDeclaredTypeInContext();
|
||||
if (CurrTy && !CurrTy->is<ErrorType>()) {
|
||||
|
||||
Reference in New Issue
Block a user