diff --git a/src/review/tools/function-reference-search-tool.ts b/src/review/tools/function-reference-search-tool.ts index 4671e56..dcd4ff8 100644 --- a/src/review/tools/function-reference-search-tool.ts +++ b/src/review/tools/function-reference-search-tool.ts @@ -80,12 +80,8 @@ export function createFunctionReferenceSearchTool(sandbox: SandboxExec): Tool { const pattern = task.patterns.join('|'); const args = [ '--json', - // 移除 --ignore-case,保持大小写敏感(大多数语言都是case-sensitive) '--max-count', String(max_results || 30), - '-e', - pattern, - context.workspacePath, ]; if (file_types && file_types.length > 0) { @@ -93,6 +89,9 @@ export function createFunctionReferenceSearchTool(sandbox: SandboxExec): Tool { args.push('--type', 'custom'); } + // -e pattern 和路径必须在所有选项之后 + args.push('-e', pattern, context.workspacePath); + try { const result = await sandbox.run('rg', args, { cwd: context.workspacePath,