cmd

package
v1.36.0 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2026 License: BSD-3-Clause Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AnalyzeCommand added in v1.33.0

func AnalyzeCommand(analyzeOpts ...AnalyzeOption) *cobra.Command

AnalyzeCommand creates the "analyze" cobra command with optional embedder configuration. Embedders can inject domain-specific expensive functions, loop keywords, and cost overrides via AnalyzeOption functions.

func DocCommand added in v1.18.0

func DocCommand(opts ...Option) *cobra.Command

DocCommand creates the "doc" cobra command with optional embedder configuration. Embedders can pass WithEnv to supply a fully configured environment (preferred) or WithRegistry to merge Go-registered packages into the default doc environment.

func Execute

func Execute()

Execute adds all child commands to the root command and sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.

func LSPCommand added in v1.26.0

func LSPCommand(opts ...Option) *cobra.Command

LSPCommand creates the "lsp" cobra command with optional embedder configuration. Embedders can pass WithRegistry or WithEnv to inject Go-registered symbols for semantic analysis.

func LintCommand added in v1.18.0

func LintCommand(opts ...Option) *cobra.Command

LintCommand creates the "lint" cobra command with optional embedder configuration. Embedders can pass WithRegistry or WithEnv to inject Go-registered symbols for semantic analysis.

Types

type AnalyzeOption added in v1.33.0

type AnalyzeOption func(*perf.Config)

AnalyzeOption configures the analyze command for embedder integration.

func WithExpensiveFunctions added in v1.33.0

func WithExpensiveFunctions(patterns ...string) AnalyzeOption

WithExpensiveFunctions appends expensive function patterns to the config. Embedders use this to inject domain-specific patterns (e.g., "statedb:*").

func WithFunctionCosts added in v1.33.0

func WithFunctionCosts(costs map[string]int) AnalyzeOption

WithFunctionCosts sets per-function cost overrides.

func WithLoopKeywords added in v1.33.0

func WithLoopKeywords(keywords ...string) AnalyzeOption

WithLoopKeywords appends loop keyword symbols to the config. Embedders use this for domain-specific iteration forms.

func WithSuppressionPrefix added in v1.33.0

func WithSuppressionPrefix(prefix string) AnalyzeOption

WithSuppressionPrefix sets the suppression comment prefix.

type Option added in v1.18.0

type Option func(*cmdConfig)

Option configures an exported command factory (LintCommand, DocCommand).

func WithEnv added in v1.18.0

func WithEnv(env *lisp.LEnv) Option

WithEnv injects a fully configured LEnv. For the doc command this is the environment used for documentation queries. For the lint command the env's Runtime.Registry is used for semantic analysis.

func WithRegistry added in v1.18.0

func WithRegistry(reg *lisp.PackageRegistry) Option

WithRegistry injects a PackageRegistry for semantic analysis. The registry's Go-registered builtins, special ops, and macros are merged with stdlib symbols so that the linter recognises embedder-provided functions.

Jump to

Keyboard shortcuts

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