Skip to content

editing python after inline if statement invalid indent #726

Closed

Description

@gkusnir
  • VSCode Version: Code 1.19.3 (7c4205b5c6e52a53b81c69d2b2dc8a627abaa0ba, 2018-01-25T10:32:23.601Z)
  • OS Version: Linux x64 4.4.0-112-generic
  • Extensions:
Extension Author (truncated) Version
bracket-pair-colorizer Coe 0.10.14
vscode-markdownlint Dav 0.13.0
xml Dot 1.9.2
beautify Hoo 1.3.0
code-settings-sync Sha 2.8.7
Bookmarks ale 0.18.1
code-gnu-global aus 0.2.2
line-counter dol 0.3.0
php-debug fel 1.12.1
phpcs ika 0.7.0
svn-scm joh 1.15.0
sublime-babel-vscode jos 0.2.9
python ms- 2018.1.0
cpptools ms- 0.14.6
csharp ms- 1.13.1
mono-debug ms- 0.15.8
debugger-for-chrome msj 4.1.0
vscode-icons rob 7.19.0
trailing-spaces sha 0.2.11
vscode-hexdump sle 1.6.0
pdf tom 0.2.0
change-case wma 1.0.0
markdown-pdf yza 0.1.7

(3 theme extensions excluded)


Steps to Reproduce:

  1. open any python file (any.py)
  2. write an if statement with true part in the same line (if True: a=1)
  3. press enter. the indent raises one level - it should not

Reproduces without extensions: N/A
turning off extensions turns off also python highlighting

Activity

  1. elliott-beach commented on Feb 8, 2018

    @elliott-beach

    Can confirm.

  2. MikhailArkhipov commented on Feb 20, 2018

    @MikhailArkhipov

    Currently indentation analysis is based on vscode (regex rules) rather than actual AST analysis so it is a bit simple

    https://github.com/Microsoft/vscode-python/blob/master/src/client/extension.ts#L129-L146

  3. 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