Skip to content

Commit 8cb9e94

Browse files
committed
fix #560
1 parent 876b01a commit 8cb9e94

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,11 @@
104104
"title": "Sort Imports",
105105
"category": "Python Refactor"
106106
},
107+
{
108+
"command": "python.startREPL",
109+
"title": "Start REPL",
110+
"category": "Python"
111+
},
107112
{
108113
"command": "python.buildWorkspaceSymbols",
109114
"title": "Build Workspace Symbols",

src/client/common/constants.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ export namespace Commands {
2323
export const Refaactor_Extract_Method = 'python.refactorExtractMethod';
2424
export const Update_SparkLibrary = 'python.updateSparkLibrary';
2525
export const Build_Workspace_Symbols = 'python.buildWorkspaceSymbols';
26+
export const Start_REPL = 'python.startREPL';
2627
export namespace Jupyter {
2728
export const Get_All_KernelSpecs_For_Language = 'jupyter:getAllKernelSpecsForLanguage';
2829
export const Get_All_KernelSpecs = 'jupyter:getAllKernelSpecs';

src/client/extension.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import * as telemetryContracts from './common/telemetryContracts';
1717
import { activateSimplePythonRefactorProvider } from './providers/simpleRefactorProvider';
1818
import { activateSetInterpreterProvider } from './providers/setInterpreterProvider';
1919
import { activateExecInTerminalProvider } from './providers/execInTerminalProvider';
20+
import { Commands } from './common/constants';
2021
import * as tests from './unittests/main';
2122
import * as jup from './jupyter/main';
2223
import { HelpProvider } from './helpProvider';
@@ -59,6 +60,12 @@ export function activate(context: vscode.ExtensionContext) {
5960
activateSimplePythonRefactorProvider(context, formatOutChannel);
6061
context.subscriptions.push(activateFormatOnSaveProvider(PYTHON, settings.PythonSettings.getInstance(), formatOutChannel));
6162

63+
context.subscriptions.push(vscode.commands.registerCommand(Commands.Start_REPL, () => {
64+
let term = vscode.window.createTerminal('Python', pythonSettings.pythonPath);
65+
term.show();
66+
context.subscriptions.push(term);
67+
}));
68+
6269
// Enable indentAction
6370
vscode.languages.setLanguageConfiguration(PYTHON.language, {
6471
onEnterRules: [

0 commit comments

Comments
 (0)