Skip to content

Moving lines after bracket-less if statement messes up indentation on Windows, Linux #62198

@fbricon

Description

@fbricon
  • VSCode Version: 1.29.0-insider (4b2fac2 2018-10-30T16:39:50.060Z)
  • OS Version: Ubuntu 18.04, Win 10

Steps to Reproduce:

  1. Create a javascript file containing an if statement without brackets, one line executed if the if statement is valid, then 2 unrelated lines next
var i = 1;
if (i === 1)
    console.log('log from if');

console.log('line one');
console.log('line two');
  1. invert the last 2 lines with alt+up or alt+down
  2. lines are indented under the if statement

indentation-issue-when-moving-lines

Does this issue occur when all extensions are disabled?: Yes

And now for the really fun part: on Mac, the same issue exists in 1.28.2, BUT works correctly in 1.29.0-insider:
oct-30-2018 16-24-12

We found the issue while trying to fix a similar problem in vscode-java, after copying the indentation rules from the js/ts server.

Metadata

Metadata

Assignees

No one assigned

    Labels

    *duplicateIssue identified as a duplicate of another issue(s)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions