packageextension

package
v0.3.12 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package packageextension defines the versioned, data-only boundary used by compiler-integrated packages. Providers receive resolved semantic facts and return ordinary TypeRB source plus a narrow call replacement; they never receive parser, checker, or typed-IR objects.

Index

Constants

View Source
const ProtocolVersion = 1

Variables

This section is empty.

Functions

func RegisterCallProvider

func RegisterCallProvider(name string, provider CallProvider)

Types

type CallSite

type CallSite struct {
	ID         string `json:"id"`
	ModulePath string `json:"modulePath"`
}

type Definition

type Definition struct {
	ModulePath string `json:"modulePath,omitempty"`
	ImportPath string `json:"importPath,omitempty"`
}

type Field

type Field struct {
	Name string `json:"name"`
	Type Type   `json:"type"`
}

type GeneratedSource

type GeneratedSource struct {
	ID     string `json:"id"`
	Source string `json:"source"`
}

type Issue

type Issue struct {
	Message string `json:"message"`
}

type Record

type Record struct {
	Fields []Field `json:"fields"`
}

type Replacement

type Replacement struct {
	Callee    string        `json:"callee"`
	Arguments []ValueSource `json:"arguments"`
}

type RequiredImport

type RequiredImport struct {
	Path    string   `json:"path"`
	Symbols []string `json:"symbols"`
}

type SpecializeCallRequest

type SpecializeCallRequest struct {
	ProtocolVersion int      `json:"protocolVersion"`
	Provider        string   `json:"provider"`
	CallSite        CallSite `json:"callSite"`
	TypeArguments   []Type   `json:"typeArguments"`
}

type SpecializeCallResponse

type SpecializeCallResponse struct {
	ProtocolVersion int              `json:"protocolVersion"`
	GeneratedSource *GeneratedSource `json:"generatedSource,omitempty"`
	Replacement     *Replacement     `json:"replacement,omitempty"`
	RequiredImports []RequiredImport `json:"requiredImports,omitempty"`
	Issues          []Issue          `json:"issues,omitempty"`
}

func SpecializeCall

func SpecializeCall(request SpecializeCallRequest) (SpecializeCallResponse, error)

type Type

type Type struct {
	Kind       string      `json:"kind"`
	Name       string      `json:"name,omitempty"`
	Nullable   bool        `json:"nullable,omitempty"`
	Arguments  []Type      `json:"arguments,omitempty"`
	Definition *Definition `json:"definition,omitempty"`
	Record     *Record     `json:"record,omitempty"`
}

type ValueSource

type ValueSource string
const ReceiverValue ValueSource = "receiver"

Jump to

Keyboard shortcuts

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