From a6fc9d943196219713dc8bf5ba8fdd32b1564ec6 Mon Sep 17 00:00:00 2001 From: Kartik Raj Date: Tue, 7 Jun 2022 16:41:41 -0700 Subject: [PATCH 1/2] Add warning icon next to problematic conda envs without an interpreter --- src/client/common/constants.ts | 1 + .../interpreterSelector/commands/setInterpreter.ts | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/src/client/common/constants.ts b/src/client/common/constants.ts index 8659c14dfd8f..8dcbf65cdda1 100644 --- a/src/client/common/constants.ts +++ b/src/client/common/constants.ts @@ -71,6 +71,7 @@ export namespace Octicons { export const Search_Stop = '$(search-stop)'; export const Star = '$(star-full)'; export const Gear = '$(gear)'; + export const Warning = '$(warning)'; } export const DEFAULT_INTERPRETER_SETTING = 'python'; diff --git a/src/client/interpreter/configuration/interpreterSelector/commands/setInterpreter.ts b/src/client/interpreter/configuration/interpreterSelector/commands/setInterpreter.ts index d55d66581b58..65d11bf0f958 100644 --- a/src/client/interpreter/configuration/interpreterSelector/commands/setInterpreter.ts +++ b/src/client/interpreter/configuration/interpreterSelector/commands/setInterpreter.ts @@ -328,6 +328,15 @@ export class SetInterpreterCommand extends BaseInterpreterSelectorCommand { if (index !== -1) { items[index] = recommended; } + items.forEach((item, i) => { + if ( + isInterpreterQuickPickItem(item) && + item.interpreter.path === 'python' && + item.interpreter.envType === EnvironmentType.Conda + ) { + items[i].label = `${Octicons.Warning} ${items[i].label}`; + } + }); } } From 4891da50138c20efe735dcd18aa2ca4751526d31 Mon Sep 17 00:00:00 2001 From: Kartik Raj Date: Tue, 7 Jun 2022 16:55:42 -0700 Subject: [PATCH 2/2] Make sure warning icon next to interpreter item isn't added multiple times on refresh --- .../interpreterSelector/commands/setInterpreter.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/client/interpreter/configuration/interpreterSelector/commands/setInterpreter.ts b/src/client/interpreter/configuration/interpreterSelector/commands/setInterpreter.ts index 65d11bf0f958..3d9cd76f9f77 100644 --- a/src/client/interpreter/configuration/interpreterSelector/commands/setInterpreter.ts +++ b/src/client/interpreter/configuration/interpreterSelector/commands/setInterpreter.ts @@ -334,7 +334,9 @@ export class SetInterpreterCommand extends BaseInterpreterSelectorCommand { item.interpreter.path === 'python' && item.interpreter.envType === EnvironmentType.Conda ) { - items[i].label = `${Octicons.Warning} ${items[i].label}`; + if (!items[i].label.includes(Octicons.Warning)) { + items[i].label = `${Octicons.Warning} ${items[i].label}`; + } } }); }