Skip to main content

Module PathExtraction

Module PathExtraction 

Source
Expand description

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.).

Functionsยง

extract_path_from_arg
Extract a filesystem path from a VS Code argument. VS Code sends URI objects { scheme: "file", path: "/C:/foo", fsPath: "C:\\foo" } but Mountain handlers expect platform-native path strings.
hex_digit
normalize_uri_path ๐Ÿ”’
percent_decode
Decode percent-encoded characters in URI paths. Handles: %20 (space), %23 (#), %25 (%), %5B ([), %5D (]), etc.
resolve_static_application_path ๐Ÿ”’
Map paths starting with /Static/Application/ to the real Sky Target directory. Also accepts the leading-slash-less form - the WASM loader (vscode-oniguruma โ†’ onig.wasm) resolves asset URLs relative to the current document, which strips the leading slash before the path reaches file:read. Without this branch, tokio::fs::read would be called with a relative path and fail with ENOENT, breaking TextMate syntax highlighting.
resolve_userdata_path ๐Ÿ”’