Skip to content

Improvements to algorithm used to identify virtual environments#2788

Merged
DonJayamanne merged 1 commit into
microsoft:masterfrom
DonJayamanne:issueFixVirtualEnvDetection
Oct 4, 2018
Merged

Improvements to algorithm used to identify virtual environments#2788
DonJayamanne merged 1 commit into
microsoft:masterfrom
DonJayamanne:issueFixVirtualEnvDetection

Conversation

@DonJayamanne

Copy link
Copy Markdown

For #

  • Pull request represents a single change (i.e. not fixing disparate/unrelated things in a single PR)
  • Title summarizes what is changing
  • [no] Has a news entry file (remember to thank yourself!)
  • Unit tests & system/integration tests are added/updated
  • [n/a] Any new/changed dependencies in package.json are pinned (e.g. "1.2.3", not "^1.2.3" for the specified version)
  • [n/a] package-lock.json has been regenerated by running npm install (if dependencies have changed)

@d3r3kk d3r3kk left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some nits that you can feel free to ignore (spelling, wording).

if (workspacesUris.findIndex(uri => event.affectsConfiguration('python.pythonPath', uri)) === -1) {
return;
}
// Lets wait, for more changes, dirty simple throttling.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not dirty, just simple.

}
this.timeOut = setTimeout(() => {
this.timeOut = undefined;
this.diagnose().then(dianostics => this.handle(dianostics)).ignoreErrors();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

speling


const pyEnvRoot = await this.getPyEnvRoot(resource);
if (pyEnvRoot && pythonPath.startsWith(pyEnvRoot)) {
if (await this.isPyEnvEnvironment(pythonPath, resource)) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like a great candidate to spark discussion of different approaches to the design. Your change here works with the current design, but also complements a future adjustment to using (perhaps) a visitor pattern type solution to determine env type. Notes for later!

Nice work.

@DonJayamanne DonJayamanne merged commit d95dc03 into microsoft:master Oct 4, 2018
@DonJayamanne DonJayamanne deleted the issueFixVirtualEnvDetection branch October 7, 2018 21:55
@DonJayamanne DonJayamanne restored the issueFixVirtualEnvDetection branch October 7, 2018 21:55
@DonJayamanne DonJayamanne deleted the issueFixVirtualEnvDetection branch October 9, 2018 22:48
@lock lock Bot locked as resolved and limited conversation to collaborators Jul 31, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants