You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add getEnvironmentVariables and onDidEnvironmentVariablesChange to IExtensionApi #15112
For #15106, I'll be adding PYTHONPATH to the LS config message, like we do the actual path to the interpreter. But, our plan is to move the client out of this extension and into Pylance (similar to how pyright is run) to reduce release friction (among other benefits in abstracting to the LSP conn). This will mean that there's no way to fetch PYTHONPATH anymore as it's effectively out-of-proc.
Similarly to the addition of getExecutionDetails and onDidChangeExecutionDetails, I'd like to have getEnvironmentVariables and onDidEnvironmentVariablesChange available to other extensions.
The interface for the environment variables is pretty small; just the event and the function that returns a Record of the environment variables. This API is already fast (cached per workspace, but really only a file read).
I have decided that getting activated environment variables for a particular environment and workspace should be a separate API than this, as that seems to me like overloading the same API.
Activity
karrtikr commentedon Oct 13, 2022
Add proposed api to get custom environment variables for a workspace (#…
karrtikr commentedon Oct 13, 2022
I have decided that getting activated environment variables for a particular environment and workspace should be a separate API than this, as that seems to me like overloading the same API.
FYI Karthik Nadig (@karthiknadig) as you described this as an issue here: https://github.com/microsoft/vscode-python/wiki/Proposed-Environment-APIs#request-for-getenvironmentvariables-and-ondidchangegetenvironmentvariables