Add command to set Python Path in DevChat configuration
- Added a new command 'devchat.PythonPath' in commands.ts. - This command prompts the user to input a Python Path and updates the DevChat configuration with the provided path. - The new command is registered in the extension.ts file.
This commit is contained in:
parent
f63f88e7f6
commit
892c3638cc
@ -5,6 +5,7 @@ import { TopicManager } from '../topic/topicManager';
|
|||||||
import { TopicTreeDataProvider, TopicTreeItem } from '../panel/topicView';
|
import { TopicTreeDataProvider, TopicTreeItem } from '../panel/topicView';
|
||||||
import { FilePairManager } from '../util/diffFilePairs';
|
import { FilePairManager } from '../util/diffFilePairs';
|
||||||
import { ApiKeyManager } from '../util/apiKey';
|
import { ApiKeyManager } from '../util/apiKey';
|
||||||
|
import { UiUtilWrapper } from '../util/uiUtil';
|
||||||
|
|
||||||
|
|
||||||
function registerOpenChatPanelCommand(context: vscode.ExtensionContext) {
|
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) {
|
export function regApplyDiffResultCommand(context: vscode.ExtensionContext) {
|
||||||
context.subscriptions.push(
|
context.subscriptions.push(
|
||||||
vscode.commands.registerCommand('devchat.applyDiffResult', async () => {
|
vscode.commands.registerCommand('devchat.applyDiffResult', async () => {
|
||||||
|
@ -13,6 +13,7 @@ import {
|
|||||||
regReloadTopicCommand,
|
regReloadTopicCommand,
|
||||||
regApplyDiffResultCommand,
|
regApplyDiffResultCommand,
|
||||||
registerStatusBarItemClickCommand,
|
registerStatusBarItemClickCommand,
|
||||||
|
regPythonPathCommand,
|
||||||
} from './contributes/commands';
|
} from './contributes/commands';
|
||||||
import { regLanguageContext } from './contributes/context';
|
import { regLanguageContext } from './contributes/context';
|
||||||
import { regDevChatView, regTopicView } from './contributes/views';
|
import { regDevChatView, regTopicView } from './contributes/views';
|
||||||
@ -51,5 +52,7 @@ function activate(context: vscode.ExtensionContext) {
|
|||||||
regSelectTopicCommand(context);
|
regSelectTopicCommand(context);
|
||||||
regReloadTopicCommand(context);
|
regReloadTopicCommand(context);
|
||||||
regApplyDiffResultCommand(context);
|
regApplyDiffResultCommand(context);
|
||||||
|
|
||||||
|
regPythonPathCommand(context);
|
||||||
}
|
}
|
||||||
exports.activate = activate;
|
exports.activate = activate;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user