@@ -1817,7 +1817,7 @@ class CompletionLookup final : public swift::VisibleDeclConsumer {
1817
1817
type = ParamDecl::getVarargBaseTy (type);
1818
1818
1819
1819
Builder.addCallParameter (param->getArgumentName (), type,
1820
- param->isVariadic ());
1820
+ param->isVariadic (), true );
1821
1821
}
1822
1822
}
1823
1823
@@ -1851,7 +1851,7 @@ class CompletionLookup final : public swift::VisibleDeclConsumer {
1851
1851
else if (IsTopLevel)
1852
1852
Builder.addAnnotatedLeftParen ();
1853
1853
Builder.addCallParameter (Identifier (), PT->getUnderlyingType (),
1854
- /* IsVarArg*/ false );
1854
+ /* IsVarArg*/ false , IsTopLevel );
1855
1855
if (IsTopLevel)
1856
1856
Builder.addRightParen ();
1857
1857
return ;
@@ -1862,7 +1862,7 @@ class CompletionLookup final : public swift::VisibleDeclConsumer {
1862
1862
else if (IsTopLevel)
1863
1863
Builder.addAnnotatedLeftParen ();
1864
1864
1865
- Builder.addCallParameter (Label, T, IsVarArg);
1865
+ Builder.addCallParameter (Label, T, IsVarArg, IsTopLevel );
1866
1866
if (IsTopLevel)
1867
1867
Builder.addRightParen ();
1868
1868
}
@@ -1937,9 +1937,10 @@ class CompletionLookup final : public swift::VisibleDeclConsumer {
1937
1937
if (BodyParams) {
1938
1938
// If we have a local name for the parameter, pass in that as well.
1939
1939
auto name = BodyParams->get (i)->getName ();
1940
- Builder.addCallParameter (Name, name, ParamType, TupleElt.isVararg ());
1940
+ Builder.addCallParameter (Name, name, ParamType, TupleElt.isVararg (),
1941
+ true );
1941
1942
} else {
1942
- Builder.addCallParameter (Name, ParamType, TupleElt.isVararg ());
1943
+ Builder.addCallParameter (Name, ParamType, TupleElt.isVararg (), true );
1943
1944
}
1944
1945
modifiedBuilder = true ;
1945
1946
NeedComma = true ;
@@ -1956,9 +1957,9 @@ class CompletionLookup final : public swift::VisibleDeclConsumer {
1956
1957
if (BodyParams) {
1957
1958
auto name = BodyParams->get (0 )->getName ();
1958
1959
Builder.addCallParameter (Identifier (), name, T,
1959
- /* IsVarArg*/ false );
1960
+ /* IsVarArg*/ false , true );
1960
1961
} else
1961
- Builder.addCallParameter (Identifier (), T, /* IsVarArg*/ false );
1962
+ Builder.addCallParameter (Identifier (), T, /* IsVarArg*/ false , true );
1962
1963
}
1963
1964
1964
1965
return modifiedBuilder;
@@ -2114,7 +2115,7 @@ class CompletionLookup final : public swift::VisibleDeclConsumer {
2114
2115
2115
2116
Builder.addLeftParen ();
2116
2117
Builder.addCallParameter (Ctx.Id_self , FirstInputType,
2117
- /* IsVarArg*/ false );
2118
+ /* IsVarArg*/ false , true );
2118
2119
Builder.addRightParen ();
2119
2120
} else {
2120
2121
Builder.addLeftParen ();
@@ -2863,7 +2864,8 @@ class CompletionLookup final : public swift::VisibleDeclConsumer {
2863
2864
builder.addTextChunk (op->getName ().str ());
2864
2865
builder.addWhitespace (" " );
2865
2866
if (RHSType)
2866
- builder.addCallParameter (Identifier (), Identifier (), RHSType, false );
2867
+ builder.addCallParameter (Identifier (), Identifier (), RHSType, false ,
2868
+ true );
2867
2869
if (resultType)
2868
2870
addTypeAnnotation (builder, resultType);
2869
2871
}
@@ -3078,15 +3080,16 @@ class CompletionLookup final : public swift::VisibleDeclConsumer {
3078
3080
builder.addTextChunk (" #Color" );
3079
3081
builder.addLeftParen ();
3080
3082
builder.addCallParameter (context.getIdentifier (" colorLiteralRed" ),
3081
- floatType, false );
3083
+ floatType, false , true );
3082
3084
builder.addComma ();
3083
3085
builder.addCallParameter (context.getIdentifier (" green" ), floatType,
3084
- false );
3086
+ false , true );
3085
3087
builder.addComma ();
3086
- builder.addCallParameter (context.getIdentifier (" blue" ), floatType, false );
3088
+ builder.addCallParameter (context.getIdentifier (" blue" ), floatType,
3089
+ false , true );
3087
3090
builder.addComma ();
3088
3091
builder.addCallParameter (context.getIdentifier (" alpha" ), floatType,
3089
- false );
3092
+ false , true );
3090
3093
builder.addRightParen ();
3091
3094
builder.addTextChunk (" #" );
3092
3095
builder.addRightBracket ();
0 commit comments