Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode auto completion to replace function call name - how to drop placeholders?

Xcode's auto-completion is often getting in my way by giving me argument placeholders when I already have them. Here's an example:

Xcode editor screenshot

I want to change that second MoveToPoint to AddLineToPoint, so I delete part of the name, and hit control + space for the Show Completions command. I get something like:

Xcode editor screenshot with auto-completion menu

You see the annoyance. I tab complete the name, but now I have to delete the 3 arguments, the commas, and the parentheses. This kind of thing annoys me and throws off my flow when writing code.

Ideally I'd like a way to delete these placeholders with one command, or have a separate auto-complete command, so along with Show Completions (control + space), I could bind something like Show Completions without Placeholders. Does anyone know how to do that?

like image 875
Rob N Avatar asked Jun 30 '13 14:06

Rob N


1 Answers

XCode does support this actually. They call it "Select Previous Completion". Check it out here (under Code Sense).

You essentially just hit ⌃> (hold control and press >) for XCode to choose your previous completion. It think it only works well though if the new method you're calling takes the same number of arguments as the previous one.

Hope this helps

like image 71
Anthony E Avatar answered Sep 22 '22 03:09

Anthony E