IntelliJ - Space after comma is replaced when entering a decimal value - intellij-idea

I am typing in the arguments for a function, and it is really annoying when IntelliJ removes the space after a comma, when entering a decimal.
Expected:
someFunction(true, .1);
Actual:
someFunction(true,.1);
The instant I press the "." key, the previous space is removed. This doesn't make any sense to me. Help is greatly appreciated!

This could be an issue with your code style for the given language.
Configuring Code Style
Hopefully that pushes you in the right direction.

Related

Intellij is incorrectly formatting my `.yml` file, I cannot see any errors in my style settings. how can I fix it?

Intellij keeps formatting my spotbugs.yml file incorrectly, and so breaking the github action.
I cannot figure out why it's doing this:
It was working fine last week, I haven't made any changes to the formatting config, but now, every time I change focus from the file Intellij auto-formats like this, then saves it. How can I fix it?
The thing I don't get is what it's formatting to appears to be invalid yaml, right?
YAML has a syntax that makes it incompatible with indentation that is not 2 spaces. With 4 spaces, you have:
droggel:
jug:
- sequence item: with indentation
this line: isn't aligned to four spaces
nor are further indented lines:
if you indent relative four spaces
spam:
- same: problem
without: indenting the sequence item
This makes it hard for code formatters to get it right. Proper alignment would mean:
droggel:
jug:
- three spaces after the sequence item indicator.
that's horrible, nobody does that.
spam:
- alternatively this.
nobody does this either and it breaks
- - with nested sequences
I assume some bug in IntelliJ causes the formatter to be confused because of this. Generally it would be better to just use 2 space indentation which seems far more natural due to the problems described above. That should avoid confusing the formatter.

IntelliJ IDEA removing the character after on reformatting code

IntelliJ removes the character after while reformatting. For example if I misspelled "Father" as "Fathr" and want to add an "e" afterwards, the editor removes the "r" on adding "e". I'm new to Kotlin and would really appreciate some help.
I am afraid this is just a simple Insert key that switches the input mode between insert (a thin cursor) and replace (a fat, character sized cursor).

invalid syntax in generating a variable in Stata

While creating this variable in stata14 I've got an error (198)
this is the variable that I want to generate:
g ncskew =(-(([_n])*([_n-1])^(1.5)*(sum(returns^3))))///
/(([_n-1])*([_n-2])*(sum(returns^2)^(1.5))
It is quite a puzzle but I think that the brackets are well placed.
Any help or advice would be appreciated.
The problem that jumps out at my eye is that the /// at the end of the first line is not preceded by any whitespace. That is a syntax error.
The other problem is that you have 13 opening parentheses ( and just 12 closing parentheses ). Is this your actual code or a mis-typed copy?
Whether that are the only problems with your code, I cannot say. If that is your actual code, fix that first and see what happens.

Emoji characters changing to unknown characters

I am working on someone's strange code and it is changing emoji characters to strange values.
This is what I wrote:
It changed into:
Can someone let me know what could be happening?
Go to Edit->Emoji and Symbols in Xcode.Type the name of symbol you want to use(in your case heart).Copy it.Then paste it the way you want. Eg:_mylabel.text=#"♥︎";

Enable show differences in line separators in a diff with Intellij IDEA 13

I'm using IDEA 13.0.1. A unit test is failing because of some line separator stuff. But when I try to compare the two results, IDEA says "Contents have differences only in line separators".
And I can't find a setting where I can say show me these differences. Is there one?
I ran into the same issue, I couldn't find a way to show the difference by clicking show differences, but if you put a break point and look at the strings, they have the line separator written out. For me one string had \n and one had \r\n. \r is also a possible line separator.
I ran into the same problem recently. I found a workaround for it, is not that pretty but did the job:
yourString.replaceAll("\n", "").replaceAll("\r", "");
The key is in what #user1633977 said.
To solve this problem, always use System.lineSeparator() to create your separators. That way they will always be the same and will be OS-independant.
(Remember that different OS can use different symbols as line separators).