mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[Concurrency] Don't lose name information from completion-handler arguments.
When a completion handler parameter has a selector piece that ends with "WithCompletion(Handler)", prepend the text before that suffix to the base name or previous argument label, as appropriate. This ensures that we don't lose information from the name, particularly with delegate names.
This commit is contained in:
@@ -442,7 +442,8 @@ public:
|
||||
///
|
||||
/// \param allPropertyNames The set of property names in the enclosing context.
|
||||
///
|
||||
/// \param isAsync Whether this is a function imported as 'async'.
|
||||
/// \param completionHandlerIndex For an 'async' function, the index of the
|
||||
/// completion handler in argNames.
|
||||
///
|
||||
/// \param scratch Scratch space that will be used for modifications beyond
|
||||
/// just chopping names.
|
||||
@@ -457,9 +458,13 @@ bool omitNeedlessWords(StringRef &baseName,
|
||||
bool returnsSelf,
|
||||
bool isProperty,
|
||||
const InheritedNameSet *allPropertyNames,
|
||||
bool isAsync,
|
||||
Optional<unsigned> completionHandlerIndex,
|
||||
Optional<StringRef> completionHandlerName,
|
||||
StringScratchSpace &scratch);
|
||||
|
||||
/// If the name has a completion-handler suffix, strip off that suffix.
|
||||
Optional<StringRef> stripWithCompletionHandlerSuffix(StringRef name);
|
||||
|
||||
} // end namespace swift
|
||||
|
||||
#endif // SWIFT_BASIC_STRINGEXTRAS_H
|
||||
|
||||
Reference in New Issue
Block a user