Skip to content

indentation from and multi-line strings/comments are incorrectly used to determine tab length #146013

@DetachHead

Description

@DetachHead

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

Version: 1.65.2 (user setup)
Commit: c722ca6
Date: 2022-03-10T14:33:55.248Z
Electron: 13.5.2
Chromium: 91.0.4472.164
Node.js: 14.16.0
V8: 9.1.269.39-electron.0
OS: Windows_NT x64 10.0.19042

Steps to Reproduce:

  1. create a new file, eg. test.py
  2. paste in the following code:
    """
      hi
    """
    
    if True:
        if True:
            print(1) 
  3. save and close the file
  4. re-open the file

the indentation margins are now 2 spaces apart instead of 4 even though the code uses 4 space indentation
image

Metadata

Metadata

Assignees

Labels

bugIssue identified by VS Code Team member as probable bugeditor-autoindentEditor auto indentation issueswont-fix

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions