fix(cli): 修复 Windows 路径反斜杠被吞掉的问题并添加跨平台路径支持

- 重写 escapeWindowsArg 函数,正确处理反斜杠和引号转义
- 添加 escapeUnixArg 函数支持 Linux/macOS shell 转义
- 添加 normalizePathSeparators 函数自动转换路径分隔符
- 修复 vscode-lsp.ts 中的 TypeScript 类型错误
This commit is contained in:
catlog22
2026-01-20 09:44:49 +08:00
parent 3fe630f221
commit eea859dd6f
3 changed files with 143 additions and 25 deletions

View File

@@ -93,7 +93,7 @@ async function callVSCodeBridge(
clearTimeout(timeoutId);
if (!response.ok) {
const errorBody = await response.json();
const errorBody = await response.json() as any;
return {
success: false,
error: errorBody.error || `HTTP ${response.status}: ${response.statusText}`,
@@ -101,7 +101,7 @@ async function callVSCodeBridge(
};
}
const data = await response.json();
const data = await response.json() as any;
return {
success: data.success !== false,
result: data.result,