zed¶
Package zed reads and updates Zed's settings.json to upsert SSH remote connections. It preserves comments and formatting by operating on the parsed JSONC structure.
Index¶
- func ResolveNickname(zedNickname, targetDisplayName, codespaceDisplayName, targetName string) string
- func ResolveSettingsPath() string
- func UpsertConnection(settings map[string]any, conn SSHConnection) map[string]any
- func UpsertConnectionInFile(settingsPath string, conn SSHConnection) error
- type Project
- type SSHConnection
- func BuildConnection(host, workspacePath, nickname string, uploadBinary *bool) SSHConnection
func ResolveNickname¶
func ResolveNickname(zedNickname, targetDisplayName, codespaceDisplayName, targetName string) string
ResolveNickname determines the nickname for a Zed connection. It checks zedNickname, targetDisplayName, codespaceDisplayName, then targetName.
func ResolveSettingsPath¶
ResolveSettingsPath returns the Zed settings.json path for the current platform.
func UpsertConnection¶
UpsertConnection merges a new SSH connection into the settings map.
func UpsertConnectionInFile¶
UpsertConnectionInFile reads, updates, and writes the Zed settings file.
type Project¶
type SSHConnection¶
type SSHConnection struct {
Host string `json:"host"`
Nickname string `json:"nickname,omitempty"`
Projects []Project `json:"projects,omitempty"`
UploadBinaryOverSSH *bool `json:"upload_binary_over_ssh,omitempty"`
Port int `json:"port,omitempty"`
Username string `json:"username,omitempty"`
}
func BuildConnection¶
BuildConnection creates an SSHConnection from target config and SSH alias.
Generated by gomarkdoc