Skip to content

moveLinesUpAction indentation broken after if statement #692

Open
@safield

Description

@safield

Version: 1.29.0-insider
Commit: 5d68db08cda5accef740c69541178911b865d069
Date: 2018-10-26T05:13:31.757Z
Electron: 2.0.12
Chrome: 61.0.3163.100
Node.js: 8.9.3
V8: 6.1.534.41
Architecture: x64

Java Language Extension version: 0.33.0

OS: Linux Mint 19

When I run the command moveLinesUpAction/DownAction, indentation can be affected when deemed proper. In certain cases indentation is erroneously affected. The erroneous behaviour is not present when Java Language Support Extension is disabled or removed.

Observe the following code:

if (blah)
    someCode;

line1;
line2;

This code is properly indented and syntactically correct.

  1. Put the caret at line2 and run moveLinesUpAction
  2. Observe that in addition to swapping lines 1 and 2, line2 will erroneously have its indentation affected by adding an additional tab in front of it.

The previously error is rectified by adding brackets to the already syntactically correct if statement.

if (blah) {
    someCode;
}

line1;
line2;

In this new example, running moveLinesUpAction/DownAction will not affect the indentation of line1/line2.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions