-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[CodeCompletion] Call argument label with value placeholder #30383
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
When a completion happens at a call argument position, insert 'label: <#T##TypeName#>' instead of just 'label: '. rdar://problem/60379654
@swift-ci Please smoke test |
lib/IDE/CodeCompletion.cpp
Outdated
Arg->getPlainType(), ContextType, | ||
Arg->isVariadic(), Arg->isInOut(), | ||
/*isIUO=*/false, Arg->isAutoClosure()); | ||
Builder.addTypeAnnotation("Argument"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@benlangmuir I don't feel right with this. What type do you think we should use here? Maybe Arg->getParameterType()
which is the type of the parameter when referenced inside the function body?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the reason to not use the same type as the placeholder?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't really have a reason. Updated to use the same type.
|
||
testPamrameterFlags(intVal, inoutArg: &intVal, autoclosureArg: intVal, iuoArg: intVal, #^ARG_PARAMFLAG_VARIADIC^#) | ||
// ARG_PARAMFLAG_VARIADIC: Begin completions, 1 items | ||
// ARG_PARAMFLAG_VARIADIC-DAG: Pattern/ExprSpecific: {#variadicArg: Int...#}[#Int#]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you really don't like this. I can make it '[#Int...#]'. But I think this is OK because this specific argument itself is Int
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree that Int
is fine here.
@swift-ci Please smoke test |
cdfabd8
to
9225cfc
Compare
@swift-ci Please smoke test |
When a completion happens at a call argument position, insert
label: <#T##TypeName#>
instead of justlabel:
.rdar://problem/60379654