Skip to content

Commit 782d5b1

Browse files
author
Kartik Raj
authored
Also show interpreter in status bar when a Python related output channel is opened (#21894)
Closes #21890
1 parent 1204011 commit 782d5b1

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/client/interpreter/interpreterService.ts

+7-2
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ import {
3131
PythonEnvironmentsChangedEvent,
3232
} from './contracts';
3333
import { traceError, traceLog } from '../logging';
34-
import { Commands, PYTHON_LANGUAGE } from '../common/constants';
34+
import { Commands, PVSC_EXTENSION_ID, PYTHON_LANGUAGE } from '../common/constants';
3535
import { reportActiveInterpreterChanged } from '../environmentApi';
3636
import { IPythonExecutionFactory } from '../common/process/types';
3737
import { Interpreters } from '../common/utils/localize';
@@ -138,7 +138,12 @@ export class InterpreterService implements Disposable, IInterpreterService {
138138
return false;
139139
}
140140
const document = this.docManager.activeTextEditor?.document;
141-
if (document?.fileName.endsWith('settings.json')) {
141+
// Output channel for MS Python related extensions. These contain "ms-python" in their ID.
142+
const pythonOutputChannelPattern = PVSC_EXTENSION_ID.split('.')[0];
143+
if (
144+
document?.fileName.endsWith('settings.json') ||
145+
document?.fileName.includes(pythonOutputChannelPattern)
146+
) {
142147
return false;
143148
}
144149
return document?.languageId !== PYTHON_LANGUAGE;

0 commit comments

Comments
 (0)