How to enable auto-indentation of Python function arguments in VS Code

Viewed 4954

I'm looking to enable automatic indentation of Python function arguments, as shown in the example below generated with use of . I had a look at a similar discussion but the discussed solutions do not appear to solve this problem.

Desired Behaviour

PyCharm

VS Code

VS Code indentation


  • VS Code version: 1.27.2
  • Python extension: 2018.8.0 (04 September 2018)

Update

  • Current autoIndent setting enter image description here
2 Answers

This is a known issue for the Python VSCode extension and it can currently not be fixed because of limitations in the extension API. More specifically the line in the editor cannot know the content of other lines. I am not aware of any fix for this issue, but I agree that it decreases the experience of working with VSCode by far.

See this issue for further information: https://github.com/Microsoft/vscode-python/issues/701

Related