Reputation: 313
Intellij keeps replacing final static variable names with random strings. I get that this idea comes from code style/best practices etc., but I find this very annoying. How do I disable this?
E.g. if I create this variable:
private static final Logger logger
= LoggerFactory.getLogger(AuthController.class);
As soon as I type "logger" and press space/enter, it replaces the name "logger" with some random string e.g. "asdoiasdk"; in the editor it then looks like:
private static final Logger asdoiasdk
= LoggerFactory.getLogger(AuthController.class);
Screenshots below:
Upvotes: 1
Views: 166
Reputation: 313
I found out why and after having spent a day on this, I'll add the reason in the hope that some other poor soul will benefit from this. Basically, the issue happens if you are using "Fantasque Sans Mono" as your editor font. I think it doesn't play well with the highlighting applied by IntelliJ for typos. E.g.: in the below example, the word "REQUESTSTART" is a typo and thus highlighted by IntelliJ (this font in this screenshot is "Droid Sans Mono"):
When I change the font to "Fantasque Sans Mono", the issue surfaces:
There is a pattern between the original string the one shown with this font - the ascii code seems to be going back two positions e.g. R->P, E->C and so on. Very interesting.
Edit 2019-04-15: See this thread for the workaround that resolved the issue for me.
Upvotes: 2