Skip to content

Indenting try/except should not go to if statement #6963

Closed
@DaMrNelson

Description

@DaMrNelson

Environment data

  • VS Code version: 1.37.0
  • Extension version: 2019.8.29288
  • OS and version: Ubuntu 18.04.3
  • Python version: 3.6.8
  • Type of virtual environment used: N/A
  • Relevant/affected Python packages and their versions:
  • Jedi or Language Server: python.jediEnabled is true

Expected behaviour

When trying except: it indents to the furthest open try:

Actual behaviour

Indents just below the furthest open block.
current

Steps to reproduce:

  1. Install Visual studio code and your extension
  2. Have a try statement, and a block after it.
  3. Type except:

Sample Code

class Test():
    def func(self):
        try:
            if True:
                if True:
                    print("hi")
        #except goes here

Logs

No related output from either source.

Metadata

Metadata

Assignees

Labels

bugIssue identified by VS Code Team member as probable bug

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions