Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to have Xcode 5 autocomplete like Visual Studio?

Tags:

Xcode 5 now displaced Xcode 4, and one common complaint that I had against both IDEs is that they don't autocomplete very aggressively. In Visual Studio, autocompletion is committed as soon as you hit a non-identifier key (like a parenthesis, a comma, a dot, a space, etc). On Xcode 5, you have to hit tab or enter.

Is there a known way to get a behavior closer to Visual Studio's for autocompletion?

like image 396
zneak Avatar asked Mar 11 '11 14:03

zneak


People also ask

How do I autocomplete in Xcode?

Press the escape key when auto-complete makes the first suggestion. This will display the list. Escape or control-comma will show the list, control-period will accept the current suggestion and (subsequently) rotate through suggestions, control-slash will move to the next placeholder argument that was inserted.

Does Xcode have IntelliSense?

Yes. XCode does have code completion a.k.a. intellisense.

How do I add autocomplete to Visual Studio?

You can trigger IntelliSense in any editor window by typing Ctrl+Space or by typing a trigger character (such as the dot character (.)

How do I change autocomplete in Visual Studio?

Go to Tools | Options | Text Editor | C/C++. This dialog displays a window that allows you to toggle Automatic brace completion. Automatic brace completion is the feature where, when you type { , a corresponding } is automatically typed for you.


2 Answers

You can select following two options from XCode->Preferences->Text Editing:

  1. Suggest completions while typing.
  2. Enable Type-over completion

Here is the image for your reference.

like image 117
Mahadev Kale Avatar answered Sep 22 '22 12:09

Mahadev Kale


You're not listing the other problem, XCode autocompletes by alphabetical values, not compatible ones. Visual Studio actually gives you things that work, but in XCode you can shove an Int to a class or visa-versa thanks to autocomplete.

The options that come closest are in XCode menu->Preferences->Text Editing. However, it doesn't have what you are after. I do notice autocompleting the brackets isn't very intelligent and I may turn mine off soon.

Anyway, the XCode alternative IDE actually has contextual autocomplete, which greatly improves your ability to code without looking at the docs. Unsure what its preferences are but it may be worth looking at. I'm not trying to advertise it so I'll let you google the XCode alternative if you want to.

In practice, the . and , "stopping" autocomplete actually saves me many times. For example, write for(int x = 0; x < 5; x++) {} then try to change the x to a y. Autocomplete will step in and completely throw you off, unless you hit space or . or ,. If you had aggressive autocomplete, it would shove in its nonworking alphabetical value at the top of the list.

Long story short, XCode 4 isn't separate from the rest of the mac, a nightmare when you try to go and use it. For one clear example, take a large text file in TextEdit, and scroll halfway down. Wait a second, now try to highlight half of the document. (Your scroll bar will disappear before you can do anything, for example).

The answer you're looking for may or may not exist, but I hoped to provide you with some alternatives that may satisfy your craving. The example at the end just shows the true nature of the tools and their UI principle.

There's always Monodevelop, (not objective C, but should be more customizable), or perhaps an ide that has Objective C, if you don't mind coding in alternatives.

Good luck, I wish XCode had more customizing too.

like image 37
Stephen J Avatar answered Sep 22 '22 12:09

Stephen J