forked from DonJayamanne/pythonVSCode
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Closed
Labels
bugIssue identified by VS Code Team member as probable bugIssue identified by VS Code Team member as probable bug
Description
Environment data
- VS Code version: 1.48.2
- Extension version (available under the Extensions sidebar): 2020.8
- OS and version: Linux Ubuntu 20.04 x86_64
- Python version (& distribution if applicable, e.g. Anaconda): 3.8.2
- Type of virtual environment used (N/A | venv | virtualenv | conda | ...): venv
- Relevant/affected Python packages and their versions: isort 5.5.1
- Relevant/affected Python-related VS Code extensions and their versions: XXX
- Value of the
python.languageServersetting: Pylance
Expected behaviour
Invoking "Refactor: sort imports" runs isort and sorts import declarations in current document
Actual behaviour
Steps to reproduce:
- install isort in venv
- configure workspace to use custom isort
- open Python file
- invoke "Refactor: sort imports" from command palette
Logs
Output:
Error: Invalid patch string: import ast
Error 2020-09-09 20:35:15: Failed to format imports for '/home/jazg/work/bbbrating/server/setup.py'. [Error: Invalid patch string: import ast
at n.y (/home/jazg/.vscode/extensions/ms-python.python-2020.8.106424/out/client/extension.js:1:515081)
at v.getWorkspaceEditsFromPatch (/home/jazg/.vscode/extensions/ms-python.python-2020.8.106424/out/client/extension.js:1:518006)
at b._provideDocumentSortImportsEdits (/home/jazg/.vscode/extensions/ms-python.python-2020.8.106424/out/client/extension.js:56:895891)
at processTicksAndRejections (internal/process/task_queues.js:85:5)]
File setup.py begins with
import ast
import codecsThis generally fails on 1st import statement (other imports in other modules).
isort itself works OK and does not produce any error on this file.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugIssue identified by VS Code Team member as probable bugIssue identified by VS Code Team member as probable bug
