-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Activate selected directory's environment within a multi-root workspace with different environments #14287
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
Comments
We have marked this issue as "needs decision" to make sure we have a conversation about your idea as we don't view this as a bug (it's really hard to infer what the user wants in a multi-root workspace with differing interpreters, e.g. did you mean to have that file open when you launched the extension or did it just happen to be open from when you last quit VS Code?). We plan to leave this feature request open for at least a month to see how many 👍 votes the opening comment gets to help us make our decision. If the automatic activation is not working for you it is possible to disable it so you can manually activate whichever environment you prefer. |
Thanks for the response. My specific setup might be a bit different than the comment I linked, but it's relatively similar with the main difference being that my virtual environment is python venv located within the individual roots (each folder). I guess maybe I should have been more descriptive of what I was expecting given my specific setup. On launching New Terminal ( Maybe this is just a user error and there is a way to do this. I'll play around.
This definitely sounds fair, maybe there is a way to not infer anything if it is not setup within a root-specific
What extension are you referring to?
This could be ideal for now. Thanks! I also would like to rename the title of this issue to something other than "Activate the environment for the open file in a multi-root workspace with differing environments" since that's not specifically my issue. A better title might be "Activate selected directory's environment within a multi-root workspace with different environments". |
Here is a gif of the use-case. |
Updated the original post. |
Our extension: the Python extension for VS Code. |
Any updates on this? |
@nikogeg nope; we would post if we had anything to share. If someone wants to propose a solution, discuss it with us, and the submit a PR we would be happy to have such a discussion. |
I have a similar use case. We have a workspace with 5 different projects, each with it's own |
Slight variation but didn't seem worth making a new issue: We use So, is it possible to add the ability to map python path per-workspace-folder? e.g.
Does pythonPath even exist any more? |
@j-m Nope,
Regarding the other ask, #18650 could also potentially help handle this scenario. |
To be honest I've moved away from doing this since this issue. |
We've gitignored the whole #18650 looks pretty good, but I'm not sure I've correctly understood what's actually changed. Could you elaborate, please? I think that feature lets you share an interpreter for all workspace folders, while this ticket is asking for a different interpreter for each workspace folder. I couldn't get the |
Reading through this thread after experiencing this issue and I have what I hope is a potential solution @brettcannon, but likely not enough knowledge of TypeScript to implement it myself. It seems like the big disconnect here boils down to the extension's behavior when receiving the
Especially given that last point, I really think the current
|
It's on our iteration plan to take a fresh look at our terminal story and the multi-root part will play into it. But beyond that there are no updates. |
Awesome, definitely looking forward to this as well! |
Closing as dup of #15522 which fixes the issue. Feel free to let us know if you still face the issue and we'll be happy to have another look. |
Looked around for open issues related to my problem; I could only find #690 -- which has been closed.
To summarize, I have several different projects mapped using [workspace name].code-workspace and in each there is a
.vscode/
containingsettings.json
with:Environment data
python.languageServer
setting: N/AExpected behaviour
On integrated prompt launch activate project's venv using its
./.vscode/settings.json
.Actual behaviour
Uses the first project's venv.
Steps to reproduce:
See this comment for a really good example.Reproducing my specific example:
python -m venv venv
from within the folder or pointing it to the root of the directory.ctrl
+shift
+" ` " to launch new terminal.NOTE: as an update (I've been playing around). The expected behavior occurs by doing the following:
f1
->Terminal: Create New Terminal (In Active Workspace)
.Logs
NOTE: could not figure out how to get the logs for the integrated terminal/workspace automation.
The text was updated successfully, but these errors were encountered: