-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Incorrect interpreter displayed in status bar in with multiple workspace folders #785
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incorrect interpreter displayed in status bar in with multiple workspace folders #785
Conversation
Archive of 0.7.0
* 'master' of https://github.com/Microsoft/vscode-python: Fixes #56 list all environments (#219) Fixes #57 Disable activation on debugging (#220) Fixes #26 Do not run linters when linters are disabled (#222)
* upstream/master: Fix typo in README.md (#252) Disable linter without workspaces (#241)
* upstream/master: Fix feedback service (#246) Fix django context initializer (#248) disable generation of tags file upon extension load (#264)
* upstream/master: Resolve pythonPath before comparing it to shebang (#273)
* upstream/master:
Fixes #22 to Detect anaconda from known locations (#221)
Use workspaceFolder token instead of workspaceRoot (#267)
Fix registry lookup response (#224)
Fix issues when running without debugging and debugged code terminates (#249)
* upstream/master: Fix debugging tests (#304)
* upstream/master: Remove jupyter functionality in favor of Jupyter extension (#302) Drop Python 2 URLs (#307)
* upstream/master: Remove setting python.formatting.formatOnSave in favor of the vs code setting (#312)
* upstream/master: Remove setting linting.lintOnTextChange as it was never implemented (#315)
* upstream/master: Fix travis build error (#326)
* upstream/master: add new npm deps with improved gulp for dev (#328)
* upstream/master: Update version of inversify package (#329)
* upstream/master: Document our dev process (#330)
* upstream/master: Document contribution to the code along with coding standards (#321)
* upstream/master: Add Simplified Chinese translation of commands (#240)
* upstream/master: Fix package.json (#347)
* upstream/master: #34, #110 - suppress Intellisense in strings and comments (#339) Re-factor code python execution framework (#345)
* upstream/master: Fix linters to make use of the new python code execution framework (#360) Update the versioning scheme (#356) Make npm happy in regards to line endings (#357)
* upstream/master: Ensure python path is not set if already set in user settings (#369) Use 'an' rather than 'a' before vowel words (#373)
* upstream/master: Use new environment variable parser (#362)
* upstream/master: Create a release candidate (#663) Activation of terminal using conda activate and fixes to powershell script execution (#665)
* upstream/master: Validate file execution handler (#698) Update contributing guide (#687) Formatting on Enter (#649) Start the 2018.2.0 alpha (#685) Prep for 2018.1 final (#683) Speed up interpreter locators (#676)
* upstream/master: Debug specific unittest test ends up running all failed tests (#671) Fix unhandled promise rejections (#702) 🐛 Fixes #700 replace back slashes in fie paths with forward slashes (#707) Validate file execution handler (#698) Update contributing guide (#687) Formatting on Enter (#649) Start the 2018.2.0 alpha (#685) Prep for 2018.1 final (#683) Speed up interpreter locators (#676) Create a release candidate (#663) Activation of terminal using conda activate and fixes to powershell script execution (#665) Register linter commands (#653) Preserve focus when sending text to a terminal (#651) Work around VSC issue with formatting on save #624 (#635) Korean translation (#540) Improving getting started instructions in README and minor updates to contributors guide (#605) Bump to a beta version for some testing (#630) Activate extension when command 'Create Terminal' is invoked (#632)
* upstream/master: Debugger unit tests (#724)
* upstream/master: Renamed default configuration name (#712) Improve tooltip display (#725)
* upstream/master: Renamed default configuration name (#712) Improve tooltip display (#725) Debugger unit tests (#724)
* upstream/master: Limit Jedi RAM consumption (#744) Fix debug test failure (#739) Ensure paths are always using forward slashes in terminal commands and args (#732)
* upstream/master: Add support for latest version of PTVSD as an experimental debugger (#745)
* upstream/master: 🐛 use 32bit integers for threadid in protocol layer (#761)
* upstream/master: 🐛 resolve pythonPath in debug config Update Jedi to 0.11.1 (#762)
} | ||
// Ensure we have separate caches per workspace where necessary.Î | ||
const workspaceService = this.serviceContainer.get<IWorkspaceService>(IWorkspaceService); | ||
if (!Array.isArray(workspaceService.workspaceFolders)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like this pattern is used quite a bit. Perhaps add something like IWorkspaceService.isSingleRoot
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
}) | ||
.catch(ex => this.getInterpretersPromise.reject(ex)); | ||
.catch(ex => deferred!.reject(ex)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this gets rejected, it will stay rejected in the cache. Intentional?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, the cache is only used while the data is being fetched.
I.e. irrespective of the cache we always fetch data when VS Code loads.
private getProspectiveDirectoriesForLookup(subDirs: string[]) { | ||
const isWindows = this.serviceContainer.get<IPlatformService>(IPlatformService).isWindows; | ||
const dirToLookFor = isWindows ? 'SCRIPTS' : 'bin'; | ||
return subDirs.map(subDir => |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can probably just await and drop try-catch since the block is just file system operations and if they fail, lots of other things will get broken anyway
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I need the try catch, because I want to ignore errors.
Codecov Report
@@ Coverage Diff @@
## master #785 +/- ##
==========================================
+ Coverage 62.85% 63.15% +0.29%
==========================================
Files 254 257 +3
Lines 11618 11735 +117
Branches 2071 2079 +8
==========================================
+ Hits 7303 7411 +108
- Misses 4307 4317 +10
+ Partials 8 7 -1
Continue to review full report at Codecov.
|
1ec3c99
to
f91a8c3
Compare
Fixes #690