79281579

Date: 2024-12-14 23:39:44
Score: 1
Natty:
Report link

In addition to "source.organizeImports": "explicit" and "isort.args":["--profile", "black"], using "isort.importStrategy": "fromEnvironment" will allow isort to use the current env to properly sort imports in files from the local / dev package being used.

From: https://marketplace.visualstudio.com/items?itemName=ms-python.isort#settings.

Full example:

{
    "[python]": {
        "editor.defaultFormatter": "ms-python.black-formatter",
        "editor.formatOnSave": true,
        "editor.codeActionsOnSave": {
          "source.organizeImports": "explicit"
    },
  },
  "isort.args":["--profile", "black"],
  "isort.importStrategy": "fromEnvironment"
}
Reasons:
  • Probably link only (1):
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: immersinn