|
1 | | -import { commands, ExtensionContext, extensions, l10n, LogOutputChannel, ProgressLocation, Terminal, Uri, window } from 'vscode'; |
| 1 | +import { |
| 2 | + commands, |
| 3 | + ExtensionContext, |
| 4 | + extensions, |
| 5 | + l10n, |
| 6 | + LogOutputChannel, |
| 7 | + ProgressLocation, |
| 8 | + Terminal, |
| 9 | + Uri, |
| 10 | + window, |
| 11 | +} from 'vscode'; |
2 | 12 | import { PythonEnvironment, PythonEnvironmentApi, PythonProjectCreator } from './api'; |
3 | 13 | import { ENVS_EXTENSION_ID } from './common/constants'; |
4 | 14 | import { ensureCorrectVersion } from './common/extVersion'; |
@@ -87,18 +97,14 @@ import { registerPoetryFeatures } from './managers/poetry/main'; |
87 | 97 | import { registerPyenvFeatures } from './managers/pyenv/main'; |
88 | 98 |
|
89 | 99 | export async function activate(context: ExtensionContext): Promise<PythonEnvironmentApi | undefined> { |
90 | | - // Use inspect() to check if the user has EXPLICITLY disabled this extension. |
91 | | - // Only skip activation if someone explicitly set useEnvironmentsExtension to false. |
92 | | - // This ignores defaultValues from other extensions' package.json and defaults to |
93 | | - // activating the extension if no explicit setting exists. |
| 100 | + // Only skip activation if user explicitly set useEnvironmentsExtension to false |
94 | 101 | const config = getConfiguration('python'); |
95 | 102 | const inspection = config.inspect<boolean>('useEnvironmentsExtension'); |
96 | | - |
97 | | - // Check for explicit false values (user deliberately disabled the extension) |
98 | | - const explicitlyDisabled = inspection?.globalValue === false || |
99 | | - inspection?.workspaceValue === false || |
100 | | - inspection?.workspaceFolderValue === false; |
101 | | - |
| 103 | + const explicitlyDisabled = |
| 104 | + inspection?.globalValue === false || |
| 105 | + inspection?.workspaceValue === false || |
| 106 | + inspection?.workspaceFolderValue === false; |
| 107 | + |
102 | 108 | const useEnvironmentsExtension = !explicitlyDisabled; |
103 | 109 | traceInfo(`Experiment Status: useEnvironmentsExtension setting set to ${useEnvironmentsExtension}`); |
104 | 110 | if (!useEnvironmentsExtension) { |
|
0 commit comments