[IDE] Complete unowned, nonisolated, access-control parameter

This commit is contained in:
Ahmed Mahmoud
2025-03-13 00:19:18 +02:00
parent 673d6a1d9f
commit 78b4e851a7
3 changed files with 101 additions and 22 deletions

View File

@@ -3105,6 +3105,16 @@ void CompletionLookup::getAttributeDeclCompletions(bool IsInSil,
void CompletionLookup::getAttributeDeclParamCompletions(
ParameterizedDeclAttributeKind AttrKind, int ParamIndex, bool HasLabel) {
switch (AttrKind) {
case ParameterizedDeclAttributeKind::Unowned:
addDeclAttrParamKeyword("safe", /*Parameters=*/{}, "", false);
addDeclAttrParamKeyword("unsafe", /*Parameters=*/{}, "", false);
break;
case ParameterizedDeclAttributeKind::Nonisolated:
addDeclAttrParamKeyword("unsafe", /*Parameters=*/{}, "", false);
break;
case ParameterizedDeclAttributeKind::AccessControl:
addDeclAttrParamKeyword("set", /*Parameters=*/{}, "", false);
break;
case ParameterizedDeclAttributeKind::Available:
if (ParamIndex == 0) {
addDeclAttrParamKeyword("*", /*Parameters=*/{}, "Platform", false);