zed-industries / zed

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
https://zed.dev
Other
49.19k stars 2.98k forks source link

Import Sorting Script for Python #4582

Open aarroisi opened 1 year ago

aarroisi commented 1 year ago

Check for existing issues

Describe the feature

Hi, I would like to be able to run script like isort after saving. It's similar to the functionality exists in VSCode with the following settings:

...,
"editor.codeActionsOnSave": {
  "source.fixAll": true,
  "source.organizeImports": true
},
...

If applicable, add mockups / screenshots to help present your vision of the feature

No response

JosephTLyons commented 1 year ago

Hi @aarroisi, you should be able to set up an external formatter with:

{
  "formatter": {
    "external": {
      "command": "sed",
      "arguments": ["-e", "s/ *$//"]
    }
  }
}

However, with that being said, we do have a limitation currently in that we only allow the user to select a single formatter. If you need multiple formatters, we have a separate issue for that behavior that you could upvote: