Skip to content

Commit

Permalink
show invalid interpreter when no interpreter is selected
Browse files Browse the repository at this point in the history
  • Loading branch information
anthonykim1 committed May 8, 2024
1 parent 03062bd commit bc9637c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/client/repl/replCommands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import {
} from 'vscode';
import { Disposable } from 'vscode-jsonrpc';
import { Commands, PVSC_EXTENSION_ID } from '../common/constants';
import { noop } from '../common/utils/misc';
import { IInterpreterService } from '../interpreter/contracts';
import { getMultiLineSelectionText, getSingleLineSelectionText } from '../terminals/codeExecution/helper';
import { createReplController } from './replController';
Expand Down Expand Up @@ -63,6 +64,10 @@ export async function registerReplCommands(
disposables.push(
commands.registerCommand(Commands.Exec_In_REPL, async (uri: Uri) => {
const interpreter = await interpreterService.getActiveInterpreter(uri);
if (!interpreter) {
commands.executeCommand(Commands.TriggerEnvironmentSelection, uri).then(noop, noop);
return;
}
if (interpreter) {
const interpreterPath = interpreter.path;
// How do we get instance of interactive window from Python extension?
Expand Down

0 comments on commit bc9637c

Please sign in to comment.