Skip to content

Commit 9659671

Browse files
authored
Merge branch 'main' into telemetry-addProject
2 parents 2d4dedf + b2b4e6e commit 9659671

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/extension.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,17 @@ async function collectEnvironmentInfo(
150150
export async function activate(context: ExtensionContext): Promise<PythonEnvironmentApi> {
151151
const start = new StopWatch();
152152

153+
// Attempt to set setting of config.python.useEnvironmentsExtension to true
154+
try {
155+
const config = workspace.getConfiguration('python');
156+
await config.update('useEnvironmentsExtension', true, true);
157+
} catch (err) {
158+
traceError(
159+
'Failed to set config.python.useEnvironmentsExtension to true. Please do so manually in your user settings now to ensure the Python environment extension is enabled during upcoming experimentation.',
160+
err,
161+
);
162+
}
163+
153164
// Logging should be set up before anything else.
154165
const outputChannel: LogOutputChannel = createLogOutputChannel('Python Environments');
155166
context.subscriptions.push(outputChannel, registerLogger(outputChannel));

0 commit comments

Comments
 (0)