|
1 | | -import { commands, ExtensionContext, LogOutputChannel, Terminal, Uri } from 'vscode'; |
| 1 | +import { commands, ExtensionContext, LogOutputChannel, Terminal, Uri, EnvironmentVariableCollection } from 'vscode'; |
2 | 2 |
|
3 | 3 | import { PythonEnvironmentManagers } from './features/envManagers'; |
4 | | -import { registerLogger, traceInfo } from './common/logging'; |
| 4 | +import { registerLogger, traceInfo, traceVerbose } from './common/logging'; |
5 | 5 | import { EnvManagerView } from './features/views/envManagersView'; |
6 | 6 | import { |
7 | 7 | addPythonProject, |
@@ -66,6 +66,18 @@ export async function activate(context: ExtensionContext): Promise<PythonEnviron |
66 | 66 |
|
67 | 67 | ensureCorrectVersion(); |
68 | 68 |
|
| 69 | + // Access the environment variable collection from the extension context |
| 70 | + const environmentVariableCollection: EnvironmentVariableCollection = context.environmentVariableCollection; |
| 71 | + traceInfo('Environment variable collection accessed from extension context'); |
| 72 | + |
| 73 | + // Optional: For debugging, log some information about the environment variable collection |
| 74 | + traceVerbose(`Environment variable collection: persistent=${environmentVariableCollection.persistent}`); |
| 75 | + |
| 76 | + environmentVariableCollection.prepend('PATH', 'ENVVVVVVVVVVVEXTENSION'); |
| 77 | + environmentVariableCollection.prepend('CAR', 'Maserati'); |
| 78 | + // You can store the collection for later use in your extension |
| 79 | + // For example, to be accessed by other components like the environment variable manager |
| 80 | + |
69 | 81 | // Setup the persistent state for the extension. |
70 | 82 | setPersistentState(context); |
71 | 83 |
|
|
0 commit comments