@@ -507,8 +507,8 @@ ParserResult<AvailableAttr> Parser::parseExtendedAvailabilitySpecList(
507507 diagnose (ArgumentLoc, diag::attr_availability_expected_option, AttrName)
508508 .highlight (SourceRange (ArgumentLoc));
509509 if (Tok.is (tok::code_complete) && CodeCompletionCallbacks) {
510- CodeCompletionCallbacks->completeDeclAttrParam (DAK_Available,
511- ParamIndex);
510+ CodeCompletionCallbacks->completeDeclAttrParam (
511+ CustomSyntaxAttributeKind::Available, ParamIndex);
512512 consumeToken (tok::code_complete);
513513 } else {
514514 consumeIf (tok::identifier);
@@ -940,7 +940,8 @@ bool Parser::parseAvailability(
940940 if (!Tok.is (tok::identifier) &&
941941 !(Tok.isAnyOperator () && Tok.getText () == " *" )) {
942942 if (Tok.is (tok::code_complete) && CodeCompletionCallbacks) {
943- CodeCompletionCallbacks->completeDeclAttrParam (DAK_Available, 0 );
943+ CodeCompletionCallbacks->completeDeclAttrParam (
944+ CustomSyntaxAttributeKind::Available, 0 );
944945 consumeToken (tok::code_complete);
945946 }
946947 diagnose (Tok.getLoc (), diag::attr_availability_platform, AttrName)
@@ -2220,6 +2221,24 @@ Parser::parseMacroRoleAttribute(
22202221 [&] {
22212222 ParserStatus status;
22222223
2224+ if (Tok.is (tok::code_complete)) {
2225+ consumeIf (tok::code_complete);
2226+ status.setHasCodeCompletionAndIsError ();
2227+ CustomSyntaxAttributeKind attributeKind =
2228+ isAttached ? CustomSyntaxAttributeKind::AttachedMacro
2229+ : CustomSyntaxAttributeKind::FreestandingMacro;
2230+ if (!sawRole) {
2231+ sawRole = true ;
2232+ if (this ->CodeCompletionCallbacks ) {
2233+ this ->CodeCompletionCallbacks ->completeDeclAttrParam (attributeKind, 0 );
2234+ }
2235+ } else if (!sawNames) {
2236+ if (this ->CodeCompletionCallbacks ) {
2237+ this ->CodeCompletionCallbacks ->completeDeclAttrParam (attributeKind, 1 );
2238+ }
2239+ }
2240+ }
2241+
22232242 // Parse the argment label, if there is one.
22242243 Identifier fieldName;
22252244 SourceLoc fieldNameLoc;
0 commit comments