Intellij changing line spacing automatically

Viewed 68

I have recently migrated to Intellij 2022.1.2 and sometimes the IDE will just change the line spacing randomly between different code sections: annotation / function definition, imports / class definition etc.

This behavior seems to be very erratic, sometimes I just restart the IDE and all lines are ok again, sometimes the changes are persistent.

Here is an example:

enter image description here

enter image description here

This is a little bit irritating. Is there any way to disable it?

2 Answers

It's a known issue that the JetBrains team claims has been resolved. The fix is available in version 2022.2 EAP 1, as indicated in the relevant ticket.

Because this is an early access version, you have to install it from JetBrains Toolbox (at your own risk), following the steps below:

enter image description here

Otherwise you can wait until it is released as a stable version.

These empty lines you see are placeholders for additional information about the code in the editor. They are called 'Inlay Hints' and you can configure them in the Settings dialog.

If they are non-empty, these lines may look like this:

Non-empty inlay hint

That these lines appear as empty placeholders is indeed irritating. Maybe it will be fixed It is already fixed in 2022.2.

Related