mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-05-17 21:12:06 +00:00
fix(cli): clean up /diff feature review issues
- Remove invalid `commandType` field from diffCommand (SlashCommand has no such property; caused a TS build failure). - Drop duplicate `NumstatResult` interface in gitDiff.ts — it is structurally identical to `GitDiffResult`. - Register the 9 missing `/diff` i18n strings in en.js / zh.js so the command is translatable (previously only `Configuration not available.` had entries).
This commit is contained in:
parent
6a0786fe74
commit
055cd85efa
5 changed files with 33 additions and 8 deletions
|
|
@ -153,6 +153,22 @@ export default {
|
|||
'Configure authentication information for login',
|
||||
'Copy the last result or code snippet to clipboard':
|
||||
'Copy the last result or code snippet to clipboard',
|
||||
'Show working-tree change stats versus HEAD':
|
||||
'Show working-tree change stats versus HEAD',
|
||||
'Could not determine current working directory.':
|
||||
'Could not determine current working directory.',
|
||||
'Failed to compute git diff stats': 'Failed to compute git diff stats',
|
||||
'No diff available. Either this is not a git repository, HEAD is missing, or a merge/rebase/cherry-pick/revert is in progress.':
|
||||
'No diff available. Either this is not a git repository, HEAD is missing, or a merge/rebase/cherry-pick/revert is in progress.',
|
||||
'Clean working tree — no changes against HEAD.':
|
||||
'Clean working tree — no changes against HEAD.',
|
||||
'{{count}} file changed, +{{added}} / -{{removed}}':
|
||||
'{{count}} file changed, +{{added}} / -{{removed}}',
|
||||
'{{count}} files changed, +{{added}} / -{{removed}}':
|
||||
'{{count}} files changed, +{{added}} / -{{removed}}',
|
||||
'…and {{hidden}} more (showing first {{shown}})':
|
||||
'…and {{hidden}} more (showing first {{shown}})',
|
||||
'(binary)': '(binary)',
|
||||
|
||||
// ============================================================================
|
||||
// Commands - Agents
|
||||
|
|
|
|||
|
|
@ -149,6 +149,21 @@ export default {
|
|||
'Configure authentication information for login': '配置登录认证信息',
|
||||
'Copy the last result or code snippet to clipboard':
|
||||
'将最后的结果或代码片段复制到剪贴板',
|
||||
'Show working-tree change stats versus HEAD':
|
||||
'显示工作区相对 HEAD 的变更统计',
|
||||
'Could not determine current working directory.': '无法确定当前工作目录。',
|
||||
'Failed to compute git diff stats': '计算 git diff 统计失败',
|
||||
'No diff available. Either this is not a git repository, HEAD is missing, or a merge/rebase/cherry-pick/revert is in progress.':
|
||||
'无可用 diff。可能不是 Git 仓库、HEAD 缺失,或正在执行 merge/rebase/cherry-pick/revert。',
|
||||
'Clean working tree — no changes against HEAD.':
|
||||
'工作区干净 —— 与 HEAD 无差异。',
|
||||
'{{count}} file changed, +{{added}} / -{{removed}}':
|
||||
'{{count}} 个文件变更,+{{added}} / -{{removed}}',
|
||||
'{{count}} files changed, +{{added}} / -{{removed}}':
|
||||
'{{count}} 个文件变更,+{{added}} / -{{removed}}',
|
||||
'…and {{hidden}} more (showing first {{shown}})':
|
||||
'…还有 {{hidden}} 个(仅显示前 {{shown}} 个)',
|
||||
'(binary)': '(二进制)',
|
||||
|
||||
// ============================================================================
|
||||
// Commands - Agents
|
||||
|
|
|
|||
|
|
@ -140,7 +140,6 @@ export const diffCommand: SlashCommand = {
|
|||
return t('Show working-tree change stats versus HEAD');
|
||||
},
|
||||
kind: CommandKind.BUILT_IN,
|
||||
commandType: 'local',
|
||||
supportedModes: ['interactive', 'non_interactive', 'acp'] as const,
|
||||
action: diffAction,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -34,11 +34,6 @@ export interface GitDiffResult {
|
|||
perFileStats: Map<string, PerFileStats>;
|
||||
}
|
||||
|
||||
export interface NumstatResult {
|
||||
stats: GitDiffStats;
|
||||
perFileStats: Map<string, PerFileStats>;
|
||||
}
|
||||
|
||||
const GIT_TIMEOUT_MS = 5000;
|
||||
/** Maximum files retained in per-file results. Matches issue #2997 "50 files" cap. */
|
||||
export const MAX_FILES = 50;
|
||||
|
|
@ -137,7 +132,7 @@ export async function fetchGitDiffHunks(
|
|||
* counts. Only the first `MAX_FILES` entries are kept in `perFileStats`, but
|
||||
* total stats account for every line.
|
||||
*/
|
||||
export function parseGitNumstat(stdout: string): NumstatResult {
|
||||
export function parseGitNumstat(stdout: string): GitDiffResult {
|
||||
const lines = stdout.split('\n').filter(Boolean);
|
||||
let added = 0;
|
||||
let removed = 0;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"generatedAt": "2026-04-22T15:40:32.318Z",
|
||||
"generatedAt": "2026-04-24T07:26:06.808Z",
|
||||
"keys": [
|
||||
" Models: Qwen latest models\n",
|
||||
" qwen auth qwen-oauth - Authenticate with Qwen OAuth (discontinued)",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue