Merge pull request #465 from devchat-ai/feat/fix-workflow
Update Devchat commands and titles
This commit is contained in:
commit
c9146b9fd3
38
package.json
38
package.json
@ -659,27 +659,27 @@
|
||||
},
|
||||
{
|
||||
"command": "devchat.addContext",
|
||||
"title": "Add to DevChat"
|
||||
"title": "Devchat:Add to DevChat"
|
||||
},
|
||||
{
|
||||
"command": "devchat.askForCode",
|
||||
"title": "Add to DevChat"
|
||||
"title": "Devchat:Add to DevChat"
|
||||
},
|
||||
{
|
||||
"command": "devchat.askForFile",
|
||||
"title": "Add to DevChat"
|
||||
"title": "Devchat:Add to DevChat"
|
||||
},
|
||||
{
|
||||
"command": "devchat.addConext_chinese",
|
||||
"title": "添加到DevChat"
|
||||
"title": "Devchat:添加到DevChat"
|
||||
},
|
||||
{
|
||||
"command": "devchat.askForCode_chinese",
|
||||
"title": "添加到DevChat"
|
||||
"title": "Devchat:添加到DevChat"
|
||||
},
|
||||
{
|
||||
"command": "devchat.askForFile_chinese",
|
||||
"title": "添加到DevChat"
|
||||
"title": "Devchat:添加到DevChat"
|
||||
},
|
||||
{
|
||||
"command": "DevChat.InstallCommands",
|
||||
@ -703,19 +703,27 @@
|
||||
},
|
||||
{
|
||||
"command": "devchat.explain",
|
||||
"title": "Generate Explain"
|
||||
"title": "Devchat:Generate Explain"
|
||||
},
|
||||
{
|
||||
"command": "devchat.explain_chinese",
|
||||
"title": "代码解释"
|
||||
"title": "Devchat:代码解释"
|
||||
},
|
||||
{
|
||||
"command": "devchat.comments",
|
||||
"title": "Generate Comments"
|
||||
"title": "Devchat:Generate Comments"
|
||||
},
|
||||
{
|
||||
"command": "devchat.comments_chinese",
|
||||
"title": "生成注释"
|
||||
"title": "Devchat:生成注释"
|
||||
},
|
||||
{
|
||||
"command": "devchat.fix",
|
||||
"title": "Devchat:Fix this"
|
||||
},
|
||||
{
|
||||
"command": "devchat.fix_chinese",
|
||||
"title": "Devchat:修复此"
|
||||
}
|
||||
],
|
||||
"keybindings": [
|
||||
@ -819,6 +827,16 @@
|
||||
"command": "devchat.comments_chinese",
|
||||
"when": "isChineseLocale && editorTextFocus && editorHasSelection",
|
||||
"group": "navigation"
|
||||
},
|
||||
{
|
||||
"command": "devchat.fix",
|
||||
"when": "!isChineseLocale && editorTextFocus && editorHasSelection",
|
||||
"group": "navigation"
|
||||
},
|
||||
{
|
||||
"command": "devchat.fix_chinese",
|
||||
"when": "isChineseLocale && editorTextFocus && editorHasSelection",
|
||||
"group": "navigation"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@ -470,7 +470,7 @@ export function registerCodeLensRangeCommand(context: vscode.ExtensionContext) {
|
||||
if (editor) {
|
||||
const range = new vscode.Range(
|
||||
new vscode.Position(pos.start, 0),
|
||||
new vscode.Position(pos.end+1, 0)
|
||||
new vscode.Position(pos.end + 1, 0)
|
||||
);
|
||||
editor.selection = new vscode.Selection(range.start, range.end);
|
||||
}
|
||||
@ -567,11 +567,31 @@ function registerCommentCommand(context: vscode.ExtensionContext) {
|
||||
);
|
||||
}
|
||||
|
||||
function registerFixCommand(context: vscode.ExtensionContext) {
|
||||
const callback = async () => {
|
||||
const editor = vscode.window.activeTextEditor;
|
||||
if (editor) {
|
||||
if (!(await ensureChatPanel(context))) {
|
||||
return;
|
||||
}
|
||||
|
||||
chatWithDevChat(ExtensionContextHolder.provider?.view()!, "/fix");
|
||||
}
|
||||
};
|
||||
context.subscriptions.push(
|
||||
vscode.commands.registerCommand("devchat.fix", callback)
|
||||
);
|
||||
context.subscriptions.push(
|
||||
vscode.commands.registerCommand("devchat.fix_chinese", callback)
|
||||
);
|
||||
}
|
||||
|
||||
export {
|
||||
registerOpenChatPanelCommand,
|
||||
registerAddContextCommand,
|
||||
registerAskForCodeCommand,
|
||||
registerAskForFileCommand,
|
||||
registerExplainCommand,
|
||||
registerFixCommand,
|
||||
registerCommentCommand,
|
||||
};
|
||||
|
@ -17,6 +17,7 @@ import {
|
||||
registerExplainCommand,
|
||||
registerCodeLensRangeCommand,
|
||||
registerCommentCommand,
|
||||
registerFixCommand,
|
||||
} from "./contributes/commands";
|
||||
import { regLanguageContext } from "./contributes/context";
|
||||
import { regDevChatView } from "./contributes/views";
|
||||
@ -414,16 +415,13 @@ async function configSetModelDefaultParams() {
|
||||
}
|
||||
|
||||
async function updateClaudePrivider() {
|
||||
const claudeModels = [
|
||||
"Model.claude-3-opus",
|
||||
"Model.claude-3-sonnet",
|
||||
];
|
||||
const claudeModels = ["Model.claude-3-opus", "Model.claude-3-sonnet"];
|
||||
|
||||
for (const model of claudeModels) {
|
||||
const modelConfig: any = UiUtilWrapper.getConfiguration("devchat", model);
|
||||
if (modelConfig && Object.keys(modelConfig).length === 0) {
|
||||
const modelProperties: any = {
|
||||
"provider": "devchat"
|
||||
provider: "devchat",
|
||||
};
|
||||
try {
|
||||
await vscode.workspace
|
||||
@ -462,6 +460,7 @@ async function activate(context: vscode.ExtensionContext) {
|
||||
registerAskForCodeCommand(context);
|
||||
registerAskForFileCommand(context);
|
||||
registerExplainCommand(context);
|
||||
registerFixCommand(context);
|
||||
registerCommentCommand(context);
|
||||
registerStatusBarItemClickCommand(context);
|
||||
|
||||
|
@ -54,7 +54,7 @@ export class CodeLensManager {
|
||||
this.registrations = [
|
||||
{
|
||||
elementType: "function",
|
||||
objectName: "unit tests",
|
||||
objectName: "Devchat:unit tests",
|
||||
promptGenerator:
|
||||
"/unit_tests {__filename__}:::{__functionName__}:::{__functionStartLine__}:::{__functionEndLine__}:::{__containerStartLine__}:::{__containerEndLine__}",
|
||||
},
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit dbdb1ba29db3536e4ae358113f4251b78845c879
|
||||
Subproject commit 874da1710f1c0e24b6c3078352919ef29b312638
|
Loading…
x
Reference in New Issue
Block a user