extensions

package
v0.1.0-rc.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 7, 2026 License: MIT Imports: 34 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package extensions bridges server-owned extensions to GUI appearance and views.

Index

Constants

View Source
const (
	StartupTimeout = 5 * time.Second
)

Variables

This section is empty.

Functions

func Install

func Install(ctx context.Context, backend *client.Client, source string) (Installed, *Bundle, error)

Install uploads a selected local package to the server. Only this explicit file-transfer source is opened locally; installed packages always live there.

func SetEnabled

func SetEnabled(ctx context.Context, backend *client.Client, id string, enabled bool) (Installed, *Bundle, error)

Enabling is prepared on the server and committed only after GUI resource validation. Failed activation preserves the installed disabled manifest.

Types

type ActionExtension

type ActionExtension struct {
	Output *output.Channel

	ID      string
	Actions []peb.Action
	// contains filtered or unexported fields
}

ActionExtension retains a validated process entry for its live button session.

func (*ActionExtension) Start

func (extension *ActionExtension) Start(values peb.SettingValues, wake func()) *ActionSession

type ActionResult

type ActionResult struct {
	Err       error
	UI        *peb.UI
	Assets    map[string][]byte
	Icons     map[string][]byte
	Lifecycle *peb.LifecycleReply
	Change    peb.ActionChange
	Token     uint64
	// Fatal marks a disconnected process; its actions must be removed.
	Fatal bool
}

type ActionSession

type ActionSession struct {
	Results <-chan ActionResult
	Done    <-chan struct{}
	// contains filtered or unexported fields
}

func (*ActionSession) Close

func (s *ActionSession) Close()

func (*ActionSession) Editor

func (s *ActionSession) Editor(a peb.Action) Editor

Editor binds a live Open With action to the extension's document process.

func (*ActionSession) NotifyFiles

func (s *ActionSession) NotifyFiles(changes peb.FileChanges)

func (*ActionSession) Submit

func (s *ActionSession) Submit(c peb.ActionContext) bool

func (*ActionSession) SubmitLifecycle

func (s *ActionSession) SubmitLifecycle(event peb.LifecycleEvent, token uint64) bool

SubmitLifecycle serializes host lifecycle events with action and UI requests.

func (*ActionSession) SubmitSettings

func (s *ActionSession) SubmitSettings(values peb.SettingValues) bool

func (*ActionSession) SubmitUI

func (s *ActionSession) SubmitUI(event peb.UIEvent) bool

type Bundle

type Bundle struct {
	ID, Label       string
	Settings        []peb.Setting
	Actions         *ActionExtension
	Themes          []Theme
	IconThemes      []peb.IconTheme
	Icons           map[string][]byte
	Editors         []Editor
	Fonts           []Font
	LanguageServers []LanguageServer
	DebugAdapters   []peb.DebugAdapter
}

Bundle owns all imported assets. No extension directory remains open after registration, and rendering performs no disk reads for extension icons.

func Load

func Load(ctx context.Context, backend *client.Client, id string) (*Bundle, error)

func (*Bundle) Close

func (b *Bundle) Close()

Close releases an unconsumed registration. Once imported into a workbench, its font registry owns these faces instead.

type Editor

type Editor struct {
	Output *output.Channel

	LocalID string
	peb.Action
	// contains filtered or unexported fields
}

Editor retains its validated process entry for on-demand activation.

func (*Editor) Start

func (editor *Editor) Start(root string, values peb.SettingValues, wake func()) *EditorSession

type EditorResult

type EditorResult struct {
	Reply   peb.EditorReply
	Err     error
	Assets  map[string][]byte
	Message peb.EditorMessage
}

type EditorSession

type EditorSession struct {
	Results <-chan EditorResult
	Done    <-chan struct{}
	// contains filtered or unexported fields
}

EditorSession owns one active document process. All pipe I/O happens on its worker; the UI submits at most one outstanding request and never blocks.

func (*EditorSession) Close

func (s *EditorSession) Close()

Close cancels asynchronously; Done closes only after the child is reaped.

func (*EditorSession) NotifyFiles

func (s *EditorSession) NotifyFiles(changes peb.FileChanges)

func (*EditorSession) Submit

func (s *EditorSession) Submit(message peb.EditorMessage) bool

func (*EditorSession) SubmitSettings

func (s *EditorSession) SubmitSettings(values peb.SettingValues) bool

type Font

type Font struct {
	Regular, Bold *font.Face
	ID, Label     string
}

Font holds parsed, memory-backed faces validated on the loader worker.

type Host

type Host struct {
	Results <-chan Result
	// contains filtered or unexported fields
}

func Start

func Start(backend *client.Client, wake func(), logs *output.Store) *Host

Start discovers packages on the server. GUI workers import only immutable resources; no process creation or installed-directory I/O happens here.

func (*Host) Close

func (h *Host) Close()

type Installed

type Installed = protocol.ExtensionInfo

type LanguageServer

type LanguageServer struct {
	Output *output.Channel

	LocalID string
	peb.LanguageServer
	// contains filtered or unexported fields
}

LanguageServer is a validated contribution. A workspace activates one process per contribution and root, shared by all matching open documents.

func (*LanguageServer) DocumentLanguage

func (s *LanguageServer) DocumentLanguage(name string) string

func (*LanguageServer) Match

func (s *LanguageServer) Match(name string) bool

func (*LanguageServer) Start

func (s *LanguageServer) Start(ctx context.Context, root string, handler lsp.Handler) (*lsp.Client, error)

type Manifest

type Manifest = protocol.ExtensionManifest

Metadata uses the same domain types on both sides of the connection.

type Result

type Result struct {
	Err    error
	Bundle *Bundle
	ID     string
}

type Theme

type Theme struct {
	Theme     *syntax.Theme
	ID, Label string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL