fix: 修复面板「重新审核」按钮失效并支持生产打包

- webview rerun 携带 currentReport.filePath
- codeReviewer.review 按 activeTextEditor.document → textDocuments
  匹配 fsPath → openTextDocument 三级解析文档,不再依赖编辑器焦点
- package.json 补 repository 字段、package-prod 为 vsce 显式提供
  base URL,解决 gittea.dev 无法自动检测仓库导致的链接解析失败
- 验证:lint 0 error / compile 通过 / npm test 183 passing
This commit is contained in:
范智鹏
2026-08-29 11:39:43 +08:00
parent 96750467d9
commit 71de0e7dc0
5 changed files with 13 additions and 6 deletions
+5 -4
View File
@@ -204,14 +204,15 @@ export function registerCommands(
): void {
context.subscriptions.push(
vscode.commands.registerCommand('codeReviewer.review', async () => {
const editor = vscode.window.activeTextEditor;
if (!editor) {
vscode.commands.registerCommand('codeReviewer.review', async (path?: { filePath?: string }) => {
const document = vscode.window.activeTextEditor?.document
?? vscode.workspace.textDocuments.find(d => d.uri.fsPath === path?.filePath)
?? (path?.filePath ? await vscode.workspace.openTextDocument(vscode.Uri.file(path.filePath)) : undefined);
if (!document) {
vscode.window.showWarningMessage(t('review.noEditor'));
return;
}
const document = editor.document;
fixSession.clear(document.uri);
pendingStore.clear(document.fileName);
const workspaceRoot = vscode.workspace.workspaceFolders?.[0]?.uri.fsPath ?? '';
+1 -1
View File
@@ -534,7 +534,7 @@ ${errorBox}
}
break;
case 'rerun':
vscode.commands.executeCommand('codeReviewer.review');
vscode.commands.executeCommand('codeReviewer.review', { filePath: this.currentReport?.filePath });
break;
case 'export':
vscode.commands.executeCommand('codeReviewer.exportReport');