Closed jvhoffbauer closed 10 months ago
You should be able to trigger sort import for Notebooks.
@Yoyokrazy This is the current selection criteria in the doc selector: https://github.com/microsoft/vscode-isort/blob/fe9b8985c0c09bf5952b4ed5de68c30c74aed365/src/common/utilities.ts#L75-L78
This should be enough as far as I understand.
@karthiknadig are you saying it should already work out of the box? maybe I misunderstood your comment. It definitely does not currently run on jupyter notebooks for me
EDIT: I think you need to put this in your settings to make it work?
"isort.args": ["--profile", "black"]
@alexdauenhauer You should be able to see what was triggered in the Output > isort logs
The command you need to call is Organize Imports
Can this be done on save? I can't seem to get it to work on save.
i have this setting for notebooks in my settings.json but i can't make it works OnSave. It's fine with editor.
"notebook.codeActionsOnSave": {
"notebook.source.organizeImports": "explicit"
},
"isort.args": [
"--profile",
"black"
],
Is it possible to use isort with Jupyter Notebooks in VSCode?