Skip to content

Formatter ignores tab size on python code #47841

@le0flo

Description

@le0flo

Reproduction steps

  1. Copy my settings
  2. Try formatting a python file that uses 2 spaces as indentation with the shortcut Ctrl+Shift+i

Current vs. Expected behavior

I would assume that the zed formatter indents my code with the specified tab size, but on python code it refuses doing 2 space tabs, only 4 spaces.

I was coding on a remote and looking through existing issues, I saw something about remotes and settings, so I thought great!! locally it must work at least, but no, nothing changed.

Zed version and system specs

Zed: v0.218.6+stable
OS: NixOS (nixpkgs unstable)
Memory: 16GB
Architecture: x86_64

Attach Zed log file

Relevant Zed settings

settings.json
{
  “hard_tabs”: false,
  “tab_size”: 2,
  “languages”: {
    “Python”: {
      “tab_size”: 2
    }
   },
  “prettier”: {
    “allowed”: false
  },
}

Relevant Keymap

keymap.json

(for AI issues) Model provider details

No response

If you are using WSL on Windows, what flavor of Linux are you using?

None

Metadata

Metadata

Assignees

No one assigned

    Labels

    .contrib/good first issueIssue suitable for first-time contributorsarea:languages/pythonPython programming language supportfrequency:commonBugs that happen for at least a third of the users across all platforms and kinds of usagepriority:P3Papercuts, minor issues with a clear workaround, cosmetic bugsstate:needs infoIssue needs more information from the user before we can do something with itstate:reproducibleVerified steps to reproduce included and someone on the team managed to reproduce

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions