Skip to content

The if statement is automatically formatted incorrectly after carriage return #1096

Description

@pcloth

Environment data

  • VS Code version: 1.21.1
  • Extension version: 2018.2.1
  • OS and version: windows 10 x64
  • Python version (Anaconda): 3.5.1
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): N/A

Case

The cursor is at (enter) position, and I press Enter:

if 1<=2: (enter)

Actual behavior

It removes spaces before expressions and inserts spaces between less than and equal signs. Causes syntax errors

if1 < = 2:
    |

If you replace 1 with a variable, there is only the error of inserting spaces before the equal sign.

if num < = 2:
    |

Expected behavior

if 1 <= 2:
    |

Activity

  1. brettcannon commented on Mar 27, 2018

    @brettcannon
    Member

    Unfortunately the PR did not fix this.

  2. brettcannon commented on Mar 27, 2018

    @brettcannon
    Member

    example

  3. added a commit that references this issue on Mar 28, 2018
    c82e04e
  4. 6 remaining items

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

Metadata

Metadata

Labels

area-formattingbugIssue identified by VS Code Team member as probable bug

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions