Skip to content

Commit

Permalink
Also show interpreter in status bar when a Python related output chan…
Browse files Browse the repository at this point in the history
…nel is opened (microsoft#21894)

Closes microsoft#21890
  • Loading branch information
Kartik Raj authored and anthonykim1 committed Sep 12, 2023
1 parent d70da2b commit ff4d75c
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/client/interpreter/interpreterService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -138,7 +138,12 @@ export class InterpreterService implements Disposable, IInterpreterService {
return false;
}
const document = this.docManager.activeTextEditor?.document;
if (document?.fileName.endsWith('settings.json')) {
// 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;
Expand Down

0 comments on commit ff4d75c

Please sign in to comment.