From 645d843dc744dacb763466dead1632f2494f932e Mon Sep 17 00:00:00 2001 From: LGUG2Z Date: Fri, 30 Oct 2026 20:59:53 -0700 Subject: [PATCH] refactor(kde): converge core/pathext.rs to the shared version Only the ResolvedPathBuf schema description changes in form: it is now chosen by cfg(target_os = "windows") so the file can be shared; on KDE the text is the same as before, so schema.json is unchanged. Verified: cargo test -p komorebi --lib pathext in komorebi-for-kde, 1 passed 0 failed. --- komorebi-for-kde/komorebi/src/core/pathext.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/komorebi-for-kde/komorebi/src/core/pathext.rs b/komorebi-for-kde/komorebi/src/core/pathext.rs index 729f7e88..81f61ea7 100644 --- a/komorebi-for-kde/komorebi/src/core/pathext.rs +++ b/komorebi-for-kde/komorebi/src/core/pathext.rs @@ -137,9 +137,15 @@ impl serde_with::schemars_1::JsonSchemaAs for ResolvedPathBuf { } fn json_schema(_generator: &mut schemars::SchemaGenerator) -> schemars::Schema { + // the description is part of the checked-in schemas, which differ per platform + #[cfg(target_os = "windows")] + let description = "A file system path. Environment variables like %VAR%, $Env:VAR, or $VAR are automatically resolved."; + #[cfg(not(target_os = "windows"))] + let description = "A file system path. Environment variables like $VAR are automatically resolved."; + schemars::json_schema!({ "type": "string", - "description": "A file system path. Environment variables like $VAR are automatically resolved." + "description": description }) } }