@@ -1946,22 +1946,8 @@ static StringRef getTypeAnnotationString(const MacroDecl *MD,
1946
1946
return {stash.data (), stash.size ()};
1947
1947
}
1948
1948
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) {
1965
1951
CodeCompletionResultBuilder Builder =
1966
1952
makeResultBuilder (CodeCompletionResultKind::Declaration,
1967
1953
getSemanticContext (MD, Reason, DynamicLookupInfo ()));
@@ -1988,6 +1974,25 @@ void CompletionLookup::addMacroExpansion(const MacroDecl *MD,
1988
1974
}
1989
1975
}
1990
1976
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
+
1991
1996
void CompletionLookup::addKeyword (StringRef Name, Type TypeAnnotation,
1992
1997
SemanticContextKind SK,
1993
1998
CodeCompletionKeywordKind KeyKind,
0 commit comments