Skip to content

Allow Activated Virtual Envs to Be Detected w/ a Workspace File #25141

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

Conversation

tgrue-openai
Copy link

@tgrue-openai tgrue-openai commented Jun 3, 2025

Addresses #25140 (which I just filed).

  1. Removed the check that a workspaceFile isn't used when looking for Activate Virtual Envs
  2. Adds a debug log to help make other forms of early exit.

Of note, I'm not sure if the existing traceVerbose('VS Code was not launched from the command line'); is correct.

As far as I can tell, workspaceFile != multiroot workspaces. I'm not sure why this check previously existed. I don't know if this might cause others problems; but right now this check causes a lot of challenge for our workflow.

@karthiknadig karthiknadig added bug Issue identified by VS Code Team member as probable bug skip tests Updates to tests unnecessary labels Jun 6, 2025
@tgrue-openai
Copy link
Author

Looks like there are two UTs failing that I will look at.

@tgrue-openai
Copy link
Author

I removed the test because it was just verifying the condition I also removed.

I considered inverting the test, but that seemed sub-optimal since you could have a limitless number of "test XYZ works when ABC is true" where ABC is many different things.

However, I'm happy to add the test back in and change it if that's prefered.

I'm also working with my company to get the CLA approval.

@tgrue-openai
Copy link
Author

@microsoft-github-policy-service agree company="OpenAI"

@eleanorjboyd
Copy link
Member

Hi! Sorry for the delay on this. Wondering if you have tried our new python environments extension and if you want the same given that extension? If so we can port over the changes to something similar on that extension since that extension will handle environment related tasks moving forward

@anthonykim1
Copy link

anthonykim1 commented Jul 9, 2025

Thanks for the PR @tgrue-openai

This looks good, the original comment and code from #20526 didn't make sense for me either, since opening multi-root workspace should be allowed when there is code-workspace file like the one you have with code ~/dev/workspace_files/infra-common.code-workspace.

@vs-code-engineering vs-code-engineering bot added this to the July 2025 milestone Jul 9, 2025
@eleanorjboyd eleanorjboyd merged commit bad502a into microsoft:main Jul 9, 2025
46 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue identified by VS Code Team member as probable bug skip tests Updates to tests unnecessary
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants