Documentation
¶
Overview ¶
Package extensions bridges server-owned extensions to GUI appearance and views.
Index ¶
- Constants
- func Install(ctx context.Context, backend *client.Client, source string) (Installed, *Bundle, error)
- func SetEnabled(ctx context.Context, backend *client.Client, id string, enabled bool) (Installed, *Bundle, error)
- type ActionExtension
- type ActionResult
- type ActionSession
- func (s *ActionSession) Close()
- func (s *ActionSession) Editor(a peb.Action) Editor
- func (s *ActionSession) NotifyFiles(changes peb.FileChanges)
- func (s *ActionSession) Submit(c peb.ActionContext) bool
- func (s *ActionSession) SubmitLifecycle(event peb.LifecycleEvent, token uint64) bool
- func (s *ActionSession) SubmitSettings(values peb.SettingValues) bool
- func (s *ActionSession) SubmitUI(event peb.UIEvent) bool
- type Bundle
- type Editor
- type EditorResult
- type EditorSession
- type Font
- type Host
- type Installed
- type LanguageServer
- type Listing
- type Manifest
- type Marketplace
- type Result
- type Theme
Constants ¶
const DefaultMarketplaceURL = "https://pencode-labs.github.io/extensions/extensions.json"
const (
StartupTimeout = 5 * time.Second
)
Variables ¶
This section is empty.
Functions ¶
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 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 a view in the window's extension 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
type Bundle ¶
type Bundle struct {
ID, Label string
LanguagePacks []localization.Pack
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.
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 view in the window's shared extension 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 releases this view asynchronously; the window's extension process stays alive.
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 Host ¶
type Host struct {
Results <-chan Result
// contains filtered or unexported fields
}
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
type Listing ¶
type Manifest ¶
type Manifest = protocol.ExtensionManifest
Metadata uses the same domain types on both sides of the connection.
type Marketplace ¶
Marketplace's zero value uses the official catalog and public GitHub API.
func (Marketplace) Install ¶
func (m Marketplace) Install(ctx context.Context, backend *client.Client, l Listing, update bool) (Installed, *Bundle, error)
Install downloads and extracts a release into disposable local staging, then validates and publishes it through the workspace server's transaction.