How can I get Xcode 6 to indent switch statements properly? - objective-c

When editing an Objective C file, the autocomplete snippet for the Switch statement looks like this.
(wow, i'd love to put the code here, but this page complains that it isn't properly formatted, which is the problem i'm asking about 9_9)
I want the case labels lined up with the switch statement. I'll even settle for the case labels indented one level.
My problem is that reinstalling Xcode doesn't fix the problem. I even used this App Cleaner app (found from the answer to a question about reinstalling Xcode here on stack overflow) to remove files associated with XCode.
I believe this problem is specific to me (instead of a bug in Xcode), because other people I ask about it don't know what I'm talking about.
So how can I get my Xcode behaving properly?
Btw, the snippet looks weird, because it's indented two spaces (I use tabs at a width of 4 spaces for my editing).
I actually got a hint from the person who allowed images in this post (I don't have a high enough score to put images).
I indent using Tabs, with a Width of 4 and Indent of 4. My problem, when the Case label are outdented, is that the switch statement is indented one tab, but the case labels are indented 2 spaces. This matches the second image where the snippet shows them indented 2 spaces.
Assuming this is just a problem with my Xcode, what I'm asking is how can I completely get rid of it and have a normal install (I tried reinstalling). On the other hand, if others have this problem too (that is, it's a bug in XCode), then I'll submit a bug report to Apple.

Try checking the Indent width at 4 spaces.
You find the following screen under "Xcode-Preferences"
Posted as an answer, cause comments don't have images.

You would like to edit the standard Xcode snippet, but Xcode doesn't allow you to do this?
Well, it looks like the right time for Snippet Edit.
It will allow you to do anything with the code snippets.
For example, my switch statement looks like this:

I had the same problem on a Mac at work, then concluded that it is a bug. What weirds me out is that I've been unable to get anyone on the internet to confirm it. Perhaps I didn't explain the issue well. Nonetheless, I submitted a bug report to Apple and it's currently marked as a Duplicate of another bug that is Open. So I expect it will be fixed.
In case anyone who comes across this is unclear on what the bug is, the bug is that the code completion snippet indents the Case label at 2 spaces. I happen to indent using Tabs, but it still indents at 2 spaces. With my tab set to a width of 4 spaces, this causes the Switch statement to indent farther than the Case label when using the auto complete. This problem is masked if you indent using Spaces, because even though the snippet indents two spaces, it will line it up with the next "tab" stop at 4 spaces (or 8 spaces, etc.).
Interestingly, it only happens when using the snippet for Objective-C. This problem doesn't occur with Swift.

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.

AppCode Indent After Comment

I'm using AppCode for Objective-C development. It seems like one of the recent updates has changed the behavior of how indents work after a comment.
Now, when I add a comment and then hit return to enter code on the next line I get this:
Hitting return again will keep the same level of indent, and hitting delete just returns the cursor to the comment line.
What I want is:
// Comment
self.theCodeStartsHere;
which I thought used to be the default.
I have also noticed that when I try to break a statement into multiple lines they no longer line up on the colons. I'm not sure if it's related, but the behavior seemed to start around the same time.
Any help would be appreciated!
After posting on YouTrack, this issue seems to be fixed in AppCode 2018.2 EAP.
EDIT: YouTrack Issue Link.

Increase size of PhpStorm error squiggly line (underwave)

Stupid tiny thing.
PhpStorm is great but when I cut and paste code sometimes I leave off a ; or a } or sometimes I have another dumb problem. PS is good at finding these trouble is it uses a fine underwave which is quite difficult to see. I know all about F2 going to next error etc. I would just love to be able to make the error pointer more obvious so I can just look at the screen and see it - a bright red highlight over the missing character or whatever. (Spot the missing ; below.)
I have trawled SO and the rest of the Interweb and have spent ages in Settings but cannot find anyway to beef this up. Any ideas where the setting for this might be?
EDIT: Just in case anyone comes this way again this is what a missing semicolon looks like now. Basically I never forget the closing semi colon or { as I have a great big red light shining in my face - perfect for a typing clutz like me.
(If you found this useful please uptick - but there seem v few phpStorm Troopers here.)
Settings/Preferences | Editor | Colors & Fonts
General | Errors & Warnings
Choose the right style (e.g. Error or Warning) and change its settings.
You will not be able to make underwave bolder, but you can choose more brighter color (which may look a bit bolder to human eye) or change underwave to another style.

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

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:

Xcode code folding issue

After updating Xcode(5.0.1),one of my project files is automatically unfolding the code every time i leave the file or close Xcode.And this weird behavior is bothering me a lot,i already tried to delete and recreate it but didn't worked.
Anyone knows what might be causing this single file to have its code unfolded?
With Xcode-9, this issue is resolved. Code folding is being remembered and saved by Xcode 9 Editor.
Code you have/had folded exact before last source build/save, is automatically stored upon document/file closure. And same will be visible as it was (folded) when you will open document/file next time.
You don't need to do anything (there is no any option in Xcode tool bar to enable or disable) to save your code fold.
There's no way around it. xCode will unfold your code automatically. Period. There is no option to "preserve" code folding. (sad, but true...)