Extension Architecture

How the six core components fit together

VS CODE LAYER
Remote Explorer
contributes.views.remote → shows SFTP Hosts section
FileSystemProvider
sftp:// URI scheme → editor reads/writes through this
EXTENSION LAYER
Connection Manager
CRUD for hosts · SecretStorage for creds · globalState for config
Webview UI
Add / edit connection form · HTML panel inside VS Code
TRANSPORT LAYER
SFTP Client
Wraps ssh2 npm library · async/await API · reconnect on drop
TREE LAYER
Tree Data Provider
Powers the Remote Explorer tree · delegates readDirectory to FileSystemProvider
DATA FLOW — opening a file
User clicks file → TreeDataProvider → openTextDocument(sftp://host/path) → FileSystemProvider.readFile() → SftpClient.read() → ssh2 over network
User saves (Ctrl+S) → FileSystemProvider.writeFile() → SftpClient.write() → ssh2 over network