@@ -1822,7 +1822,7 @@ class CompletionLookup final : public swift::VisibleDeclConsumer {
1822
1822
type = ParamDecl::getVarargBaseTy (type);
1823
1823
1824
1824
Builder.addCallParameter (param->getArgumentName (), type,
1825
- param->isVariadic ());
1825
+ param->isVariadic (), true );
1826
1826
}
1827
1827
}
1828
1828
@@ -1856,7 +1856,7 @@ class CompletionLookup final : public swift::VisibleDeclConsumer {
1856
1856
else if (IsTopLevel)
1857
1857
Builder.addAnnotatedLeftParen ();
1858
1858
Builder.addCallParameter (Identifier (), PT->getUnderlyingType (),
1859
- /* IsVarArg*/ false );
1859
+ /* IsVarArg*/ false , IsTopLevel );
1860
1860
if (IsTopLevel)
1861
1861
Builder.addRightParen ();
1862
1862
return ;
@@ -1867,7 +1867,7 @@ class CompletionLookup final : public swift::VisibleDeclConsumer {
1867
1867
else if (IsTopLevel)
1868
1868
Builder.addAnnotatedLeftParen ();
1869
1869
1870
- Builder.addCallParameter (Label, T, IsVarArg);
1870
+ Builder.addCallParameter (Label, T, IsVarArg, IsTopLevel );
1871
1871
if (IsTopLevel)
1872
1872
Builder.addRightParen ();
1873
1873
}
@@ -1942,9 +1942,10 @@ class CompletionLookup final : public swift::VisibleDeclConsumer {
1942
1942
if (BodyParams) {
1943
1943
// If we have a local name for the parameter, pass in that as well.
1944
1944
auto name = BodyParams->get (i)->getName ();
1945
- Builder.addCallParameter (Name, name, ParamType, TupleElt.isVararg ());
1945
+ Builder.addCallParameter (Name, name, ParamType, TupleElt.isVararg (),
1946
+ true );
1946
1947
} else {
1947
- Builder.addCallParameter (Name, ParamType, TupleElt.isVararg ());
1948
+ Builder.addCallParameter (Name, ParamType, TupleElt.isVararg (), true );
1948
1949
}
1949
1950
modifiedBuilder = true ;
1950
1951
NeedComma = true ;
@@ -1961,9 +1962,9 @@ class CompletionLookup final : public swift::VisibleDeclConsumer {
1961
1962
if (BodyParams) {
1962
1963
auto name = BodyParams->get (0 )->getName ();
1963
1964
Builder.addCallParameter (Identifier (), name, T,
1964
- /* IsVarArg*/ false );
1965
+ /* IsVarArg*/ false , true );
1965
1966
} else
1966
- Builder.addCallParameter (Identifier (), T, /* IsVarArg*/ false );
1967
+ Builder.addCallParameter (Identifier (), T, /* IsVarArg*/ false , true );
1967
1968
}
1968
1969
1969
1970
return modifiedBuilder;
@@ -2122,7 +2123,7 @@ class CompletionLookup final : public swift::VisibleDeclConsumer {
2122
2123
2123
2124
Builder.addLeftParen ();
2124
2125
Builder.addCallParameter (Ctx.Id_self , FirstInputType,
2125
- /* IsVarArg*/ false );
2126
+ /* IsVarArg*/ false , true );
2126
2127
Builder.addRightParen ();
2127
2128
} else {
2128
2129
Builder.addLeftParen ();
@@ -2920,7 +2921,8 @@ class CompletionLookup final : public swift::VisibleDeclConsumer {
2920
2921
builder.addTextChunk (op->getName ().str ());
2921
2922
builder.addWhitespace (" " );
2922
2923
if (RHSType)
2923
- builder.addCallParameter (Identifier (), Identifier (), RHSType, false );
2924
+ builder.addCallParameter (Identifier (), Identifier (), RHSType, false ,
2925
+ true );
2924
2926
if (resultType)
2925
2927
addTypeAnnotation (builder, resultType);
2926
2928
}
@@ -3135,15 +3137,16 @@ class CompletionLookup final : public swift::VisibleDeclConsumer {
3135
3137
builder.addTextChunk (" #Color" );
3136
3138
builder.addLeftParen ();
3137
3139
builder.addCallParameter (context.getIdentifier (" colorLiteralRed" ),
3138
- floatType, false );
3140
+ floatType, false , true );
3139
3141
builder.addComma ();
3140
3142
builder.addCallParameter (context.getIdentifier (" green" ), floatType,
3141
- false );
3143
+ false , true );
3142
3144
builder.addComma ();
3143
- builder.addCallParameter (context.getIdentifier (" blue" ), floatType, false );
3145
+ builder.addCallParameter (context.getIdentifier (" blue" ), floatType,
3146
+ false , true );
3144
3147
builder.addComma ();
3145
3148
builder.addCallParameter (context.getIdentifier (" alpha" ), floatType,
3146
- false );
3149
+ false , true );
3147
3150
builder.addRightParen ();
3148
3151
builder.addTextChunk (" #" );
3149
3152
builder.addRightBracket ();
0 commit comments