20

The debugger is really (de)bugging me. Every time I try to type a po ... command, it autocompletes (without giving me any options) and I end up typing stuff like po [selfelf and so on until I go mad. Is there any way of stopping this, or of always giving me the autocomplete popup like in the standard editor?

jrturton
  • 118,105
  • 32
  • 252
  • 268
  • Yeah, I have the same problem. This used to work correctly for a while, by which I mean the auto-complete part would be grayed and it wouldn't try to do it again with every character. It would eventually get screwed up, but now it's always that way. Has anyone bothered filing a RADAR with Apple? – David Gish Jan 17 '12 at 17:21
  • [Code Sense](http://cocoadev.com/wiki/CodeSense) started showing popup autocomplete menus for me in the debugger the other night and then went away, which is a beautiful 'solution' to this problem. More info over [here](http://stackoverflow.com/questions/12220682/how-to-make-xcode-4-4-debug-console-use-a-popup-for-autocomplete). Would be interested to hear if you have found an other acceptable solution. – NSTJ Oct 15 '12 at 03:16
  • Either I've got used to it, and/or the change to LLDB and newer versions of Xcode (this question is pretty old now) have sorted this out for me. I don't have any other solution, and I'm not even sure the accepted answer works for LLDB (I'll look it up as it still seems to be getting upvoted...) – jrturton Oct 15 '12 at 06:05
  • @TomJowett [this](http://www.stuartcarnie.com/2012/06/lldb-vi-mode-and-tab-completion.html?m=1) has potential, if you get anywhere with it I will happily change over the accepted answer. – jrturton Oct 15 '12 at 06:11
  • Thanks, that looks like a nice solution, although having the Code Sense menus (if only for a few builds after which they disappeared) has set the bar quite high. – NSTJ Oct 15 '12 at 06:19
  • @jrturton looks like the popup menu strikes more often than not on my machine these days. Check [this](http://tinypic.com/r/25jcs5u/6) out. Seriously it makes me so much more productive when this menu is there. – NSTJ Oct 19 '12 at 15:29
  • @TomJowett oh, yes please! If only that came up all the time. Massive bounty in it for you if you can tell me how to set that up. – jrturton Oct 19 '12 at 17:51
  • It keeps coming and going. One thing I have noticed though is that pressing the escape key consistently pops up the menu, however it is promptly dismissed. This is like the holy grail for me! – NSTJ Oct 21 '12 at 02:11
  • @jrturton - looks like Xcode 4.6 does the code-completion popup menu fulltime (although good luck debugging using it...) – NSTJ Mar 15 '13 at 16:59

2 Answers2

8

This answer applied to the GDB debugger which is no longer the standard debugger used with Xcode

This is achieved by adding the following line to the "readline init file" (which, by default, I think does not exist). I created the file ~/.inputrc and put the following text in it:

set disable-completions 'On'
jrturton
  • 118,105
  • 32
  • 252
  • 268
  • @kiamlaluno that back tick was supposed to be there, did you have a reason for removing it? I got it from http://docs.freebsd.org/info/readline/readline.info.Readline_Init_File_Syntax.html – jrturton Dec 29 '11 at 08:08
  • I think that site is not correctly using the back tick. If you look at that page you linked, they use the back tick at the beginning of a string, which is then ended by a single-quote character; it is probable they should use the single-quote character at the beginning of the string too. – apaderno Dec 29 '11 at 08:18
  • I assumed it was a freaky UNIX thing. It does work with the back tick! I haven't tried it with single quotes. – jrturton Dec 29 '11 at 08:21
  • Does this disable auto-complete for the whole IDE or just the debugger? – Hari Honor Feb 24 '12 at 10:03
  • Just the debugger - but I have been through several upgrades of Xcode and OS X since I posted this answer, I don't know if it still works or if they've just improved the behaviour in new versions... – jrturton Feb 24 '12 at 10:06
3

Hmm, the accepted answer is kind of overkill.

How about the answer provided to this question:

The closest I've come to solving this incredibly annoying problem is to turn off automatic code completion in general (Preferences > Text Editing > Suggest Completions While Typing) and then hit esc whenever I actually do want code completion.

Community
  • 1
  • 1
mts
  • 608
  • 6
  • 11
  • 1
    IIRC that didn't work with the version of Xcode / gdb that was in use at the time. Thanks for the update though. – jrturton Nov 26 '11 at 07:23