Skip to content

WRONG_INDENTATION: a newline after ( within an expression should result in the extended indent for the remainder of the expression #1448

@0x6675636b796f75676974687562

Description

Consider this fragment (extendedIndentForExpressionBodies is off, extendedIndentAfterOperators is on). Note the expressions are wrapped immediately after the opening parenthesis:

val v1 = (
        true)

val v2 = (
        1 + 2)

This is exactly how IDEA with Kotlin style settings applied formats the fragment:

IDEA

For IDEA, the continuation indent is non-configurable and is always on.

diKTat

Expected behaviour

For diKTat, the indent within an expression should depend on the value of extendedIndentAfterOperators.

Actual behaviour

Still, diKTat expects a single indent regardless of extendedIndentAfterOperators. In fact, none of the extendedIndent* flags can change the actual behaviour in this context.

Notes

Environment information

  • diktat version: 1.2.2-SNAPSHOT at a17825a

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions