fix(http-client): find the generated request scratch on Windows (#356)

Generate Request in HTTP Client (and Generate Requests for Controller, and the gutter icon) left the scratch file empty on Windows with "Cannot open file …\ai.l0ng.openidea/scratches/generated-requests.http": the scratch path joined the native app data directory (backslashes) with a /-separated suffix, so the opened editor could not be found by its path. Scratch paths now normalise the app data directory to the UI's /-separated form through a shared ipcPath helper, used by scratches, the HTTP client and Spring request generation.

Co-authored-by: kevinh458 <[email protected]>

未在 Windows 实机验证。
Цей коміт міститься в:
kevinh authored and GitHub committed 2026-10-30 15:09:50 +08:00
1 джерело 9575500dd6
коміт 9d1fe17894
7 files changed
+144 -4

No files matched your search

+2 -1
Переглянути файл
@@ -7,6 +7,7 @@
* plain JSON (localStorage, keyed by project root) and rebuilt into a fresh
* TabsState with new ids.
*/
import { ipcPath } from "@/platform/paths";
import type { EditorInput } from "@/workbench/contributions";
import { initialTabsState, paneIds, type LayoutNode, type Pane, type Tab, type TabsState } from "./tabs";
@@ -91,7 +92,7 @@ export function serializeSession(
* and `\\?\C:\a\b` become `C:/a/b`. Other paths are returned as is.
*/
export function slashPath(p: string): string {
return /^(\\\\\?\\)?[A-Za-z]:\\/.test(p) ? p.replace(/^\\\\\?\\/, "").replace(/\\/g, "/") : p;
return ipcPath(p);
}
function isSessionTab(v: unknown): v is SessionTab {