Documentation
¶
Index ¶
Constants ¶
const ( ForwardPortsOption = "FORWARD_PORTS" BindAddressOption = "BIND_ADDRESS" VersionOption = "VERSION" DownloadAmd64Option = "DOWNLOAD_AMD64" DownloadArm64Option = "DOWNLOAD_ARM64" )
const DefaultVSCodeWebPort = 10802
DefaultVSCodeWebPort sits next to openvscode (10800) and code-server (10801) so a host running all three only collides under the FindAvailablePort fallback path, not by default.
Variables ¶
var Options = ide.Options{ ForwardPortsOption: { Name: ForwardPortsOption, Description: "If Devsy should automatically do port-forwarding", Default: "true", Enum: []string{"true", "false"}, }, BindAddressOption: { Name: BindAddressOption, Description: "The address to bind VS Code Web to locally, e.g. 0.0.0.0:12345", Default: "", }, VersionOption: { Name: VersionOption, Description: "The VS Code version for the serve-web CLI " + "(a release version like 1.96.4, or 'latest')", Default: "1.96.4", }, DownloadArm64Option: { Name: DownloadArm64Option, Description: "The download url for the arm64 VS Code CLI", }, DownloadAmd64Option: { Name: DownloadAmd64Option, Description: "The download url for the amd64 VS Code CLI", }, }
Functions ¶
This section is empty.
Types ¶
type ServerOptions ¶
type ServerOptions struct {
Extensions []string
Settings string
UserName string
Host string
Port string
Values map[string]config.OptionValue
}
ServerOptions configures a VSCodeWeb instance.
type VSCodeWeb ¶
type VSCodeWeb struct {
// contains filtered or unexported fields
}
VSCodeWeb installs the official VS Code CLI and runs it as `code serve-web` inside the workspace, serving the browser IDE backed by the Microsoft Marketplace.
func NewVSCodeWeb ¶
func NewVSCodeWeb(opts ServerOptions) *VSCodeWeb
func (*VSCodeWeb) Install ¶
Install downloads the VS Code CLI tarball, extracts the `code` binary under <home>/.vscode-web, and writes settings.json. The download is skipped only when the existing install already matches the requested release (tracked via a marker file), so changing VERSION / DOWNLOAD_* triggers a reinstall. settings.json is rewritten on every call so workspace settings stay current.
func (*VSCodeWeb) InstallExtensions ¶
InstallExtensions installs each requested extension via the VS Code CLI. Partial failures are logged and tolerated; an aggregated error is returned only when every requested extension fails to install.