diff --git a/src/contributes/commands.ts b/src/contributes/commands.ts index 082181e..31b4c92 100644 --- a/src/contributes/commands.ts +++ b/src/contributes/commands.ts @@ -5,6 +5,7 @@ import { TopicManager } from '../topic/topicManager'; import { TopicTreeDataProvider, TopicTreeItem } from '../panel/topicView'; import { FilePairManager } from '../util/diffFilePairs'; import { ApiKeyManager } from '../util/apiKey'; +import { UiUtilWrapper } from '../util/uiUtil'; function registerOpenChatPanelCommand(context: vscode.ExtensionContext) { @@ -148,6 +149,21 @@ export function regReloadTopicCommand(context: vscode.ExtensionContext) { ); } +export function regPythonPathCommand(context: vscode.ExtensionContext) { + context.subscriptions.push( + vscode.commands.registerCommand('devchat.PythonPath', async () => { + const pythonPath = await vscode.window.showInputBox({ + title: "Set Python Path", + placeHolder: "Set Python Path" + }) ?? ''; + + if (pythonPath) { + vscode.workspace.getConfiguration("DevChat").update("PythonPath", pythonPath, vscode.ConfigurationTarget.Global); + } + }) + ); +} + export function regApplyDiffResultCommand(context: vscode.ExtensionContext) { context.subscriptions.push( vscode.commands.registerCommand('devchat.applyDiffResult', async () => { diff --git a/src/extension.ts b/src/extension.ts index d9cdbf9..cb6279c 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -13,6 +13,7 @@ import { regReloadTopicCommand, regApplyDiffResultCommand, registerStatusBarItemClickCommand, + regPythonPathCommand, } from './contributes/commands'; import { regLanguageContext } from './contributes/context'; import { regDevChatView, regTopicView } from './contributes/views'; @@ -51,5 +52,7 @@ function activate(context: vscode.ExtensionContext) { regSelectTopicCommand(context); regReloadTopicCommand(context); regApplyDiffResultCommand(context); + + regPythonPathCommand(context); } exports.activate = activate;