Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Also show interpreter in status bar when a Python related output channel is opened #21894

Merged
merged 2 commits into from
Aug 29, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading