Documentation
¶
Index ¶
- Constants
- func LoadPackage(env *lisp.LEnv) *lisp.LVal
- func LookupSymbolDoc(env *lisp.LEnv, sym string) string
- func RenderPackageList(w io.Writer, env *lisp.LEnv) error
- func RenderPkgExported(w io.Writer, env *lisp.LEnv, query string) error
- func RenderVar(w io.Writer, env *lisp.LEnv, sym string) error
- type FormalsDoc
- type MissingDoc
- type PackageDoc
- type SymbolDoc
Constants ¶
const DefaultPackageName = "help"
DefaultPackageName is the package name used by LoadPackage.
Variables ¶
This section is empty.
Functions ¶
func LoadPackage ¶
LoadPackage adds the help package to env
func LookupSymbolDoc ¶ added in v1.23.1
LookupSymbolDoc resolves a symbol's documentation from its package. Handles qualified names (pkg:sym) and unqualified names (current package). Returns "" if the environment is not fully initialized.
func RenderPackageList ¶ added in v1.16.12
RenderPackageList writes a summary of all loaded packages to w. Each package is listed with its name, export count, and first line of its doc string (if any). Packages are sorted alphabetically.
func RenderPkgExported ¶
RenderPkgExported writes to w formatted documentation for exported symbols in the query package within env. The exact formatting of the rendered documentation is subject to change across elps versions.
Types ¶
type FormalsDoc ¶ added in v1.32.0
type FormalsDoc struct {
Required []string `json:"required"`
Optional []string `json:"optional,omitempty"`
Rest string `json:"rest,omitempty"`
Keys []string `json:"keys,omitempty"`
}
FormalsDoc describes a function's parameter list.
type MissingDoc ¶ added in v1.17.0
type MissingDoc struct {
// Kind is the type of the symbol: "builtin", "special-op", "macro",
// "package", or a function type string (e.g. "function").
Kind string
// Name is the qualified name of the symbol (e.g. "math:sin").
Name string
}
MissingDoc describes a symbol with no documentation.
func CheckMissing ¶ added in v1.17.0
func CheckMissing(env *lisp.LEnv) []MissingDoc
CheckMissing reports symbols missing documentation in the given environment. It checks core builtins/ops/macros (from DefaultBuiltins etc.), package-level docs, and exported symbol docs for all packages in env.Runtime.Registry.
type PackageDoc ¶ added in v1.32.0
type PackageDoc struct {
Name string `json:"name"`
Doc string `json:"doc,omitempty"`
Symbols []SymbolDoc `json:"symbols"`
}
PackageDoc describes a package for JSON output.
func QueryPackage ¶ added in v1.32.0
func QueryPackage(env *lisp.LEnv, name string) (*PackageDoc, error)
QueryPackage returns structured documentation for a single package.
func QueryPackages ¶ added in v1.32.0
func QueryPackages(env *lisp.LEnv) []PackageDoc
QueryPackages returns structured documentation for all packages in the environment, suitable for JSON serialization.
type SymbolDoc ¶ added in v1.32.0
type SymbolDoc struct {
Name string `json:"name"`
Kind string `json:"kind"` // "function", "macro", "operator", "variable"
Doc string `json:"doc,omitempty"`
Formals *FormalsDoc `json:"formals,omitempty"` // nil for non-functions
}
SymbolDoc describes a documented symbol for JSON output.