Provide a public API to set the environment to a given path #16504
Replies: 3 comments 6 replies
-
@brettcannon do you see any reason not to provide such an API? (i.e.: would it be Ok if a pull request was created to do that?) The one thing I can think of is that there could be a security risk if any extension could set the interpreter, but maybe it'd be Ok if the python extension confirmed with the user (requiring a UI confirmation) when such a call is made? |
Beta Was this translation helpful? Give feedback.
-
I have the same use case (explained in #16915). I understand the security concerns but in my use case these are mandatory functions. At least I would need a command to know which interpreter is active, something like const interpreterPath = await vscode.commands.executeCommand("python.interpreter") as string; That way I can at least show the user a popup that he/she needs to change the interpeter. In my case the user will get a lot of such toast message which is never really a good UX. Maybe have a "set command" which would inform the user that the change was done (and if the user like could be undone) could also be an option.
|
Beta Was this translation helpful? Give feedback.
-
Moved to #16994 |
Beta Was this translation helpful? Give feedback.
-
I have an extension that currently changes the python executable being used by setting it in the user or workspace settings.json (depending how the user chooses to do it).
In the description of https://github.com/microsoft/vscode-python/wiki/AB-Experiments#deprecatepythonpath, I can't really see any way for an extension to update the python used by the vscode-python extension after the move to stop using the settings.json.
So, this is a request to provide an API/command to provide parity with what was already available prior to this change (or if there is already a way to do it, document it in https://github.com/microsoft/vscode-python/wiki/AB-Experiments#deprecatepythonpath).
Originally posted by @fabioz in a discussion
Beta Was this translation helpful? Give feedback.
All reactions