Skip to main content

Module FileSystem

Expand description

File-system-domain handlers for CocoonService. Eleven entry points covering read/write/stat, directory ops, watch, glob/text search, and delete/rename/copy/create-directory.

Modules§

CopyFile
Copy a file, creating any missing target parents first.
CreateDirectory
Create a directory (and any missing parents).
DeleteFile
Remove a file or recursively remove a directory.
FindFiles
Walk every workspace root collecting paths that match pattern (globset). Falls back to cwd when no roots are open.
FindTextInFiles
Substring search across the workspace, capped at 1,000 matches. Skips hidden directories plus node_modules and target. Runs the walk in tokio::task::spawn_blocking so the event loop stays responsive.
ReadFile
Read a file from disk and return its bytes (always tagged utf-8 - the encoding negotiation lives in Cocoon).
Readdir
Enumerate the entries of a directory by name.
RenameFile
Rename a file or directory, creating any missing target parents first.
Stat
Inspect a path: type, size, mtime in ms-since-epoch.
WatchFile
watch_file gRPC endpoint - Cocoon calls this when an extension uses vscode.workspace.createFileSystemWatcher. Routes to Mountain’s FileWatcherProvider::RegisterWatcher so OS events (FSEvents on macOS, inotify on Linux) flow back to Cocoon as $fileWatcher:event gRPC notifications which Cocoon fans out to extension onDidChangeFile listeners.
WriteFile
Write bytes to disk, creating any missing parent directories.