editor¶
Package editor abstracts editor-specific operations for launching and configuring remote connections to codespaces. Implementations exist for Zed and Neovim.
Index¶
- func ResolveNickname(zedNickname, targetDisplayName, codespaceDisplayName, targetName string) string
- type Editor
- func ForName(name string) (Editor, error)
- type NeovimEditor
- func (n *NeovimEditor) ConfigureConnection(sshAlias, workspacePath, nickname string, uploadBinary *bool) error
- func (n *NeovimEditor) FindBinary() (string, error)
- func (n *NeovimEditor) LaunchRemote(sshAlias, workspacePath string) error
- func (n *NeovimEditor) Name() string
- type ZedEditor
- func (z *ZedEditor) ConfigureConnection(sshAlias, workspacePath, nickname string, uploadBinary *bool) error
- func (z *ZedEditor) FindBinary() (string, error)
- func (z *ZedEditor) LaunchRemote(sshAlias, workspacePath string) error
- func (z *ZedEditor) Name() string
func ResolveNickname¶
func ResolveNickname(zedNickname, targetDisplayName, codespaceDisplayName, targetName string) string
ResolveNickname determines the nickname for a connection. Checks zedNickname, targetDisplayName, codespaceDisplayName, then targetName.
type Editor¶
Editor abstracts editor-specific operations.
type Editor interface {
// Name returns the editor identifier (e.g. "zed", "neovim").
Name() string
// FindBinary locates the editor's CLI binary on PATH.
FindBinary() (string, error)
// ConfigureConnection sets up editor-specific config for the SSH
// connection (e.g. Zed's settings.json). No-op for editors that
// don't need it.
ConfigureConnection(sshAlias, workspacePath, nickname string, uploadBinary *bool) error
// LaunchRemote opens the editor connected to the remote codespace.
LaunchRemote(sshAlias, workspacePath string) error
}
func ForName¶
ForName returns an Editor implementation for the given name. An empty name defaults to "zed".
type NeovimEditor¶
NeovimEditor implements Editor for Neovim via SSH.
type NeovimEditor struct {
// Terminal is the terminal app to use for launching Neovim.
// Empty string means auto-detect.
Terminal string
}
func (*NeovimEditor) ConfigureConnection¶
func (n *NeovimEditor) ConfigureConnection(sshAlias, workspacePath, nickname string, uploadBinary *bool) error
func (*NeovimEditor) FindBinary¶
func (*NeovimEditor) LaunchRemote¶
func (*NeovimEditor) Name¶
type ZedEditor¶
ZedEditor implements Editor for the Zed text editor.
func (*ZedEditor) ConfigureConnection¶
func (z *ZedEditor) ConfigureConnection(sshAlias, workspacePath, nickname string, uploadBinary *bool) error
func (*ZedEditor) FindBinary¶
func (*ZedEditor) LaunchRemote¶
func (*ZedEditor) Name¶
Generated by gomarkdoc