forked from DonJayamanne/pythonVSCode
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Closed
Labels
area-intellisenseLSP-related functionality: auto-complete, docstrings, navigation, refactoring, etc.LSP-related functionality: auto-complete, docstrings, navigation, refactoring, etc.bugIssue identified by VS Code Team member as probable bugIssue identified by VS Code Team member as probable bug
Milestone
Description
Environment data
- VS Code version: 1.32.3 (have also seen this on older versions)
- Extension version: 2019.2.5558 (have also seen this on older versions)
- OS and version: Ubuntu 16.04.6
- Python version: 3.5.2 (have also seen this on other versions)
- Type of virtual environment used: venv
- Relevant/affected Python packages and their versions: I currently have isort 4.3.15, though I've seen this on older versions
Expected behaviour
That when running the "Sort Imports" command on a file, the imports are sorted according to my setup.cfg
config regardless of whether the file is currently saved or not.
Actual behaviour
When running the "Sort Imports" command on a file:
- If the file is saved, my
setup.cfg
config is respected - If the file has modifications, my
setup.cfg
config is not respected
Steps to reproduce:
Given this config:
# setup.cfg
[isort]
length_sort = True
# demo.py
import os
import logging
import collections
- put
setup.cfg
anddemo.py
next to each other in a new folder - open that folder as a workspace in VSCode
- open
demo.py
- "Sort imports" within
demo.py
, it should be unchanged - edit
demo.py
, without saving it - "Sort imports" within
demo.py
, note that its imports have changed ordering to ignore thelength_sort
option
This reproduces with much more complex configs, and other options are also ignored, so I strongly suspect the setup.cfg
file isn't being picked up as a whole if the file is modified.
ian-h-chamberlain, swarnendubiswas, cory1979 and shughes-uk
Metadata
Metadata
Assignees
Labels
area-intellisenseLSP-related functionality: auto-complete, docstrings, navigation, refactoring, etc.LSP-related functionality: auto-complete, docstrings, navigation, refactoring, etc.bugIssue identified by VS Code Team member as probable bugIssue identified by VS Code Team member as probable bug