Skip to main content

Module Utilities

Module Utilities 

Source
Expand description

Utilities for Wind handlers, grouped by purpose. Sub-module helpers (hex_digit, percent_decode, normalize_uri_path, etc.) stay co- located with their single public entry point - splitting by strict one- fn-per-file would fragment tightly coupled internals for no readability gain.

No pub use. External callers must spell Utilities::<Domain>::<Function>.

Modules§

ApplicationRoot
/Static/Application/ → Sky Target real path. The static root is seeded once by AppLifecycle::Dirs with the resolved Sky/Target directory (debug) or the bundle resource dir (release) so file:read on any Static/Application/... URI lands on the real asset.
ChannelPriority
Maps a wire command string → Echo scheduler lane via the Common Channel registry’s Priority() accessor. Unknown commands fall back to Priority::Normal so unclassified callers don’t starve the high-priority queue.
JsonValueHelpers
Serde-Value helpers shared across Wind handlers. v_str extracts a string from either a raw JSON string or a VS Code UriComponents object (external / path field). Any new cross-cutting coercer that accepts both shapes belongs here.
MetadataEncoding
Converts std::fs::Metadata to VS Code’s IStat wire shape. The FileType bits are VS Code’s enum (File=1, Directory=2, SymbolicLink=64); the readdir atoms also emit these values.
PathExtraction
Converts VS Code Uri-shaped arguments to platform-native paths. Co-locates percent-decoding, userdata remapping, and /Static/Application rewriting because each is a private helper of extract_path_from_arg. Percent-decoding is also re-exported for callers outside the VFS path (configuration loaders, etc.).
RecentlyOpened
Recently-opened workspaces/files persistence. File lives at ~/.land/workspaces/RecentlyOpened.json. Parse failures degrade to an empty {workspaces, files} envelope so the UI never sees a missing field.
UserdataDir
Canonical userdata base directory (Tauri app_data_dir) + first-access scaffolding. Seeded by AppLifecycle::Dirs so every /User/... URI the renderer emits lands under the bundle-identifier-qualified Application Support path VS Code’s profile system expects.