[swift-dev] [Swift 2.2] Request to merge code completion for #selector

Ted Kremenek kremenek at apple.com
Tue Feb 2 19:30:06 CST 2016


Hi Doug,

These changes don’t cherry-pick cleanly to swift-2.2-branch.

Please create a pull request for swift-2.2-branch that cherry-picks in these changes and resolves the merge conflicts.

Otherwise, Approved for Swift 2.2.

Ted

> On Feb 2, 2016, at 4:39 PM, Douglas Gregor <dgregor at apple.com> wrote:
> 
> Hi Ted,
> 
> The #selector expression has both a discoverability and a usability problem due to fairly poor code completion. These two changes:
> 
> 	https://github.com/apple/swift/commit/9736d54a771e87cc37be5c040404f6e387f766ec
> 	https://github.com/apple/swift/commit/f5cb1151c1ba4d8e40705ff31cb17c74c97daa4a
> 
> introduce much better code completion for #selector. The first commit makes
> 
> 	#selector(<#@objc method#>)
> 
> an expression-specific (i.e., very high priority) completion when code-completing an argument for a parameter of type “ObjectiveC.Selector”, e.g.,
> 
> 	obj.performSelector(<complete here and get #selector(<#@objc method#>)>
> 
> while the second provides compound-name completions for method references within a #selector subexpression, e.g.,
> 
> 	#selector(NSObject.<complete here>
> 
> will give completions like
> 
> 	performSelector(_:withObject:)
> 
> and
> 
> 	init
> 
> and so on.
> 
> 
> 	- Doug
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-dev/attachments/20160202/061ec39c/attachment.html>


More information about the swift-dev mailing list