visual studio code – VSCode Extension to fix inconsistent tab issue of Python

visual studio code – VSCode Extension to fix inconsistent tab issue of Python

You can fix the tab inconsistency by converting all indentation to tab or spaces.
If you open the Show All Commands tab, ( by pressing Ctrl+Shift+P or F1 ) and search for convert indentation, two options will by available:

  • convert indentation to tabs
  • convert indentation to spaces

Just choose tabs if you use tabs or spaces if use spaces as your indentation method.

By default vscode use four spaces instead of a tab. See your configuration options:

When opening a file, editor.tabSize and editor.insertSpaces will
be detected based on the file contents.

  editor.detectIndentation: true

Insert spaces when pressing Tab. This setting is overridden based on
the file contents when editor.detectIndentation is on.

  editor.insertSpaces: true

The number of spaces a tab is equal to. This setting is overridden
based on the file contents when editor.detectIndentation is on.

  editor.tabSize: 4

visual studio code – VSCode Extension to fix inconsistent tab issue of Python

  1. click : ctrl+shift+p or right click on the mouse and select
    Command Plate – this will prompt a list.
    2.select from list: Convert Indentation to Spaces

Related posts

Leave a Reply

Your email address will not be published.