From 20e244057092825622de62762f32b30685a77432 Mon Sep 17 00:00:00 2001 From: Kartik Raj Date: Tue, 29 Aug 2023 12:04:04 -0700 Subject: [PATCH 1/2] Also show interpreter in status bar when a Python related output channel is opened --- src/client/interpreter/interpreterService.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/client/interpreter/interpreterService.ts b/src/client/interpreter/interpreterService.ts index 3cfb651977bb..e7a9a5b65117 100644 --- a/src/client/interpreter/interpreterService.ts +++ b/src/client/interpreter/interpreterService.ts @@ -31,7 +31,7 @@ import { PythonEnvironmentsChangedEvent, } from './contracts'; import { traceError, traceLog } from '../logging'; -import { Commands, PYTHON_LANGUAGE } from '../common/constants'; +import { Commands, PVSC_EXTENSION_ID, PYTHON_LANGUAGE } from '../common/constants'; import { reportActiveInterpreterChanged } from '../environmentApi'; import { IPythonExecutionFactory } from '../common/process/types'; import { Interpreters } from '../common/utils/localize'; @@ -138,7 +138,7 @@ export class InterpreterService implements Disposable, IInterpreterService { return false; } const document = this.docManager.activeTextEditor?.document; - if (document?.fileName.endsWith('settings.json')) { + if (document?.fileName.endsWith('settings.json') || document?.fileName.includes(PVSC_EXTENSION_ID)) { return false; } return document?.languageId !== PYTHON_LANGUAGE; From 443178cfa14771a15c6ac2abc97b4548a202d04f Mon Sep 17 00:00:00 2001 From: Kartik Raj Date: Tue, 29 Aug 2023 12:28:26 -0700 Subject: [PATCH 2/2] Amend --- src/client/interpreter/interpreterService.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/client/interpreter/interpreterService.ts b/src/client/interpreter/interpreterService.ts index e7a9a5b65117..b595fc2365a8 100644 --- a/src/client/interpreter/interpreterService.ts +++ b/src/client/interpreter/interpreterService.ts @@ -138,7 +138,12 @@ export class InterpreterService implements Disposable, IInterpreterService { return false; } const document = this.docManager.activeTextEditor?.document; - if (document?.fileName.endsWith('settings.json') || document?.fileName.includes(PVSC_EXTENSION_ID)) { + // Output channel for MS Python related extensions. These contain "ms-python" in their ID. + const pythonOutputChannelPattern = PVSC_EXTENSION_ID.split('.')[0]; + if ( + document?.fileName.endsWith('settings.json') || + document?.fileName.includes(pythonOutputChannelPattern) + ) { return false; } return document?.languageId !== PYTHON_LANGUAGE;