Is there a way to disable a specific code completion macro in Xcode 6? - objective-c

Xcode's desire to complete certain things drives me nuts. If I type "else" and hit return, for example, I want to just end up on the next line after my "else", but instead I accidentally select Xcode's "else" completion and I'm still on the same line, which is literally never what I want. I like code completion in general, it's these ones that effectively replace normal code typing that bother me. Is there a way to disable specific completions in Xcode 6? This question asked basically the same thing (the author was even also bugged by the "else" completion – seriously, Apple, please remove that one), but all of the answers to it are out of date and do not apply to Xcode 6. (I would have just commented on that question, but doing so requires 50 reputation, so I had to start a new question instead, grr.) Xcode 6 has the macro browser thing where you can add new completions, but it does not seem to be possible to disable their built-in completions there. Is there a config file somewhere that can be edited?

The problem that Xcode doesn't have completion snippet for "else" statement. It has only for "if" and "if - else" statements.
I propose to create custom snippet for your goal.
Here is an example how it should look like:

Related

Having difficulty getting ZeroBrane to highlight code, autocomplete, etc

https://i.imgur.com/SlQ41BS.jpg
Here is an example. For some reason code is simply not being highlighted using the Lua 5.2 interpreter. Autocomplete doesn't appear to be working correctly either. Also whenever I declare a function it doesn't automatically add a space in the middle and the end at the bottom which I've seen. These would all be immensely helpful starting off. I have never coded before.
I don't see any issue with the highlighting, as the Lua code in your snapshot is highlighted. I'm not sure why auto-complete is not working in your case, but if you type "pr" and don't see "print" and "pairs" offered when Lua 5.2 interpreter is selected, you may want to open a ticket and we'll investigate.

Typo in IntelliJ manual?

From IntelliJ 14 help:
There are certain cases when IntelliJ IDEA will not stop at a
breakpoint. Consider the following situation: Two breakpoints are set
at the different methods of a class, and there suspend policy is set
to All. When one of the breakpoints is hit, some step actions are
performed. If at the time of stepping another thread hits the second
breakpoint, profuct will not stop there.
I thought it's a typo but "product will not stop there" still doesn't make sense.
I'm pretty sure they mean that the execution will not stop there, but I was wondering what the word there was supposed to be?
The word was supposed to be "IntelliJ IDEA" (it's a macro which gets replaced with the actual product name when the help is generated).

Set breakpoint in VBA code programmatically

I have a very large piece of code written in VBA (>50,000 lines - numerous modules). There is one array of interest to me, and I'd like to find all the conditions under which the value of any element of this array changes. The values can change in any module. Running the script line by line is not the most efficient option due to the size of the code.
I am looking for better ways to solve this problem. Two ways that come to my mind is to programmatically set a breakpoint (which I am not sure if can be done) or programmatically insert an if-block after each assignment that somehow alerts me that the value has changed. (not preferred).
So my question boils down to:
Is it possible to programmatically set breakpoints in VBA code?
If the answer to the above question is No, what is an efficient way to solve this problem?
UPDATE:
Thanks for the comments/replies. As I had implied, I am interested in the least amount of modification to the current code (i.e. inserting if-blocks, etc) and most interested in the break-point idea. I'd like to know if it's doable.
Use the keyword STOP to break te code if a certain condition is true.
There are Two Ways to do that:
Use Stop Key word. Example as given below, set a break point at Stop
if (x = 21 ) Then
Stop
End If
Using Add Watch
Go to Debug -> Select Add Watch
NB:I know this is an old topic but this could help others.
You could use Watches:
Right click on the variables you wish to monitor -> Add Watch...
In Watch Type: 'Break when value changes'
While you run your code, you can check the status of your Watches thanks to the Watch Window (accessible from the 'View' menu)
in the hope someone can benefit from this :
In such situations regardless of the programming language used - writing a few lines of code either in Perl, AWK or even shell scripts can solve the problem :
search for a regular expression containing the array name (ignoring case).
Once you export all modules and classes in the Workbook(s) into a given directory - the scripts can search those for you.

Xcode 4 debugger code completion

First off, it is nice that they are trying to get code completion on the gdb command prompt in Xcode 4. But in its current state, it makes using the command prompt to investigate objective c objects nearly impossible - when I'm typing, it autocompletes the word to something I didn't want, and there is no way to undo this without manually selecting the text and removing it, then starting over.
I should probably file a bug with apple for this, but in the meantime, does anyone have a work around for this (like say, turning off auto-completion for the debugger without turning it off for code editing - I like auto-completion in obj-c because method names are so long :).
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.

How can replace the string [Foo alloc]<cursor> with [[Foo alloc]<cursor>]

Is there a key shortcut for this in XCode?
Can I implement an Applescript for this and run it within XCode?
You can probably do that using a script (check out the relevent piece of Xcode documentation). Also see the "Insert Text Macro" menu item…
But you might find it to be more efficient to just use the auto-correct feature. I just type "[[F", then hit my auto-correct key (bound to F5 I believe, but I've changed it), type enough of the class name for it to be selected in the autocorrect popup. Hit space, start typing alloc but let auto correct kick in. Close the brace. Start typing init, use autocorrect again.
You generally shouldn't need to create macros/scripts for something this trivial. The autocorrect, placeholders and autofill features should be all you really need.
I see that this question was asked some time ago. For anyone just stumbling on it, current versions of Xcode (3.2+) will fill in the open brackets for you as you go (what crackity_jones calls "auto-back fill"). That is, if you type
[Foo alloc]<cursor>
and then keep going...
[Foo alloc] init<cursor>
...when you type the next close bracket, Xcode will insert the corresponding open bracket in the correct place:
[[Foo alloc] init]<cursor>
Try it out. While this doesn't answer the original question directly, it does address the need.
Textmate will auto-back fill ['s for you. You can also build your xcode project from inside it as well as do thousands of other interesting things with the objective-c and other built in bundles that add functionality. It has a 30 day demo, give it a shot and see if it does what you want.