AppCode Indent After Comment - objective-c

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.

Related

How to Remove Unnecessary Line Spacing in Code Editor?

How can I get rid of the unnecessary line breaks in the Java code editor (see screenshot). This formatting seems to apply just to one project. When I create new projects, there is no extra line spacing.
Thanks!
I believe this is related to Inlay Hints. I had the same issue and it was driving me nuts, then after a restart a bunch of code hints showed up. While useful in the right circumstance, it was a bit baffling when all I could see were these ghost lines.
After disabling "Code vision" the issue resolved itself.
Go to settings (Ctrl-Alt-S), under Editor-Inlay Hints there is a checkbox for Code vision. Uncheck that and see if that helps.
This appears to be an issue with the 2022.1 version of IDEA. I had the same symptoms and downgraded to 2021.3. Poof, problem solved. Hopefully they fix this in a newer version soon.
This is indeed related to Editor -> Inlay Hints -> Code vision settings, but for me, it is the Code author option specifically that is adding the seemingly-needless lines.
It seems like IntelliJ creates affordance for the Code author value, but (for me) the value is empty so there is actually nothing showing.
I leave the other Code vision options enabled and just disable the Code author and this appears to be working well so far.

How can I stop IntelliJ IDEA printing an empty new line?

I am following the Atomic Kotlin course. I have understood the concept and my output is correct, however Intellij IDEA complains that the outputs are different. Even when I copy and paste from the answer. Please see screenshot.
I have tried using the print() method instead of println(), but it didn't help.
Go to Settings->Editor->General and uncheck the Ensure an empty line.. property.
see the following screenshot:
There is a straightforward workaround on how one can avoid this problem. Changing the AtomicKotlin/Programming Basics/Data Types/Exercise 2/test/output.txt manually to add a new line at the end of the text should fix the test.I've also found a YouTrack ticket with the problem description. According to it, EduTools 4.2 version release should fix it. Maybe it worth to upvote or comment on the ticket.

Can't toggle off block comments in VSCode

In basically any language, like css/scss/js I can select a block of text and use the editor.action.blockComment action to surround the text with /* */, and that works fine, but to remove it I have to select the comment EXACTLY and activate the command again. I should be able to just put the caret anywhere inside the commented section and hit the key and it will be uncommented but that just puts another comment inside it. I even tried it in Sublime and it uncomments it perfectly as long as the caret is inside the commented section.
Please help! What am I doing wrong? There's no way that’s just the way it is.
Thanks in advance!
~Neil
I'm on the VSCode team.
As of VSCode 1.9, what you describe is the expected behavior of toggle block comment. If you would like to see this improved, please open a feature request and we'll take a look. This issue already describes a similar problem.

Is it possible to disable duplicate code detection in Intellij?

Is it possible to disable duplicate code detection in Intellij?
I haven't found this feature to be useful and it continues to distract me.
Only available in IntelliJ Ultimate:
To disable duplicate code detection, go to
File → Settings → Editor → Inspections → General → Duplicated code fragment
and uncheck box "Duplicate code fragment".
Add a hint to your code so that others will know your intent:
#SuppressWarnings("Duplicates")
Yes, it's possible, but I would strongly advise against it!
Duplicate code is a form of technical debt. Any duplicated code that contains a bug means you now have a duplicated bug - you then run the risk that when you fix it, you'll only fix it in one place and the duplicate will remain...
If duplicate code warnings are distracting you, then the best strategy for getting rid of them is to remove the code duplication... Your codebase and future maintainers will thank you for it
This answer may be little irrelevant, but I found this helpful,
From this answer if you want to disable it for a specific code block, not the entire method or class or ide, then just add the following line just before that code block
//noinspection Duplicates
Note: You can not put any other comment after this line.
Could not get any of these answers to work in Webstorm.
To work around this without turning this feature off, I added this line of code:
if (Math.random() === 1) console.info('suppress duplicate code warning')
This makes the warning disappear if you add it in 1 of the 2 dupe files since they are not dupe anymore.
Another alternative if you are using lodash is:
noop('suppress duplicate code warning')

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: