Skip to content

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

Closed

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.

Activity

  1. vscodebot commented on Oct 30, 2018

    @vscodebot

    (Experimental duplicate detection)
    Thanks for submitting this issue. Please also check if it is already covered by an existing one, like:

  2. kieferrm commented on Oct 30, 2018

    @kieferrm
    Member

    /duplicate of #43244

  3. added
    *duplicateIssue identified as a duplicate of another issue(s)
    on Oct 30, 2018
  4. vscodebot commented on Oct 30, 2018

    @vscodebot

    Thanks for creating this issue! We figured it's covering the same as another one we already have. Thus, we closed this one as a duplicate. You can search for existing issues here. See also our issue reporting guidelines.

    Happy Coding!

  5. locked and limited conversation to collaborators on Dec 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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