Android studio Incorrect whitespace warning every new line

312 Views Asked by At

Starting with Android Studio Electric Eel (problem still present in 2022.1.1 Patch 2) I'm experiencing a problem with formatting warnings.

  • I have Incorrect formatting warnings enabled from the settings.
  • Every time a add a new line, since the IDE adds an indentation that follows the previous line one, I see a warning:

enter image description here

If I remove the indentation at the start of the line, the warning disappears.

enter image description here

This isn't ideal, since the indentation is removed automatically by the IDE when the file is saved. So the warning shouldn't appear. In Android Studio versions before Electric Eel it always worked fine.

I already tried invalidating/resetting the cache and nothing changed.

Do you know if it's an IDE bug? or am I missing something?

1

There are 1 best solutions below

2
On

Yeah, i think it's what @ToxicFlame427 said. it looks there's an existing bug. im experiencing the same problem using Flaming 2022.22.01 | Patch 1

This bug from Google seems to be related to this issue: https://issuetracker.google.com/issues/273454808