Commit c22862e
committed
feat(Cocoon): enhance workspace FS API handlers with improved error handling and option support
- Refactored error handling by centralizing `create_handler_error_string` and `map_common_error_to_handler_string` into `error_utils.rs`, promoting consistency across RPC handlers
- Added detailed parameter validation for FS operations (stat, readFile, delete, etc.), including recursive directory creation and overwrite flags
- Implemented proper option parsing for `writeFile`, `delete`, `rename`, and `copy` to align with VS Code API semantics (e.g., `recursive`, `useTrash`)
- Enhanced URI scheme validation to strictly enforce 'file' scheme usage and reject unsupported protocols like 'vscode-remote'
- Added comprehensive logging with debug/trace levels to improve observability of FS operations in Mountain backend
- Updated handler signatures to use `AppRuntime` directly for cleaner Environment access and trait requirement
- Aligned JSON response structures with VS Code's `FileStat` DTO format, including proper base64 encoding for file contents
These changes ensure Land's `vscode.workspace.fs` shim layer accurately mimics VS Code's behavior, critical for extension compatibility in the Cocoon sidecar while maintaining security through strict path validation.1 parent 15678ac commit c22862e
1 file changed
Lines changed: 460 additions & 290 deletions
0 commit comments