Home > OS >  Pylance: remove the first module in auto import
Pylance: remove the first module in auto import

Time:06-27

How can I force pylance to remove the first module in auto imports?

i.e. change

from backend.api.bills.serializers import ...

to

from api.bills.serializers import ...

I tries these settings.json:

{
    "python.linting.cwd": "${workspaceFolder}\\backend",
    "python.analysis.extraPaths": ["${workspaceFolder}\\backend\\.."],
    "python.autoComplete.extraPaths": ["${workspaceFolder}\\backend\\.."],
    "python.analysis.indexing": true,
    "editor.formatOnSave": true
}

CodePudding user response:

Not entirely sure on why one might need this, but I think you can open your editor from inside the backend/ folder and trick pylance

  • Related