@@ -1946,22 +1946,8 @@ static StringRef getTypeAnnotationString(const MacroDecl *MD,
19461946 return {stash.data (), stash.size ()};
19471947}
19481948
1949- void CompletionLookup::addMacroExpansion (const MacroDecl *MD,
1950- DeclVisibilityKind Reason) {
1951- if (!MD->hasName () || !MD->isAccessibleFrom (CurrDeclContext) ||
1952- MD->shouldHideFromEditor ())
1953- return ;
1954-
1955- OptionSet<CustomAttributeKind> expectedKinds =
1956- expectedTypeContext.getExpectedCustomAttributeKinds ();
1957- if (expectedKinds) {
1958- CodeCompletionMacroRoles expectedRoles =
1959- getCompletionMacroRoles (expectedKinds);
1960- CodeCompletionMacroRoles roles = getCompletionMacroRoles (MD);
1961- if (!(roles & expectedRoles))
1962- return ;
1963- }
1964-
1949+ void CompletionLookup::addMacroCallArguments (const MacroDecl *MD,
1950+ DeclVisibilityKind Reason) {
19651951 CodeCompletionResultBuilder Builder =
19661952 makeResultBuilder (CodeCompletionResultKind::Declaration,
19671953 getSemanticContext (MD, Reason, DynamicLookupInfo ()));
@@ -1988,6 +1974,25 @@ void CompletionLookup::addMacroExpansion(const MacroDecl *MD,
19881974 }
19891975}
19901976
1977+ void CompletionLookup::addMacroExpansion (const MacroDecl *MD,
1978+ DeclVisibilityKind Reason) {
1979+ if (!MD->hasName () || !MD->isAccessibleFrom (CurrDeclContext) ||
1980+ MD->shouldHideFromEditor ())
1981+ return ;
1982+
1983+ OptionSet<CustomAttributeKind> expectedKinds =
1984+ expectedTypeContext.getExpectedCustomAttributeKinds ();
1985+ if (expectedKinds) {
1986+ CodeCompletionMacroRoles expectedRoles =
1987+ getCompletionMacroRoles (expectedKinds);
1988+ CodeCompletionMacroRoles roles = getCompletionMacroRoles (MD);
1989+ if (!(roles & expectedRoles))
1990+ return ;
1991+ }
1992+
1993+ addMacroCallArguments (MD, Reason);
1994+ }
1995+
19911996void CompletionLookup::addKeyword (StringRef Name, Type TypeAnnotation,
19921997 SemanticContextKind SK,
19931998 CodeCompletionKeywordKind KeyKind,
0 commit comments