Documentation
¶
Overview ¶
Package code implements `sf code` — a compact structural summary of source files, without function bodies, so the agent needn't cat a whole file just to see its shape/API (where read tokens go in practice).
This package is a thin ROUTER: it dispatches each file by extension to a per-language backend library (gocode, phpcode, tscode), runs multiple files in parallel, and aggregates the results. Each backend is small and tested in isolation. The router owns the cross-cutting concerns: the compact-or-raw token-saver invariant (internal/emit — emit the summary only when it is actually cheaper than the raw file, else hand back the raw bytes), call-log accounting, and single-symbol slice mode.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewCommand ¶
NewCommand returns the `code` Cobra command (`sf code`).
Types ¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package gocode is the Go backend for `sf code`: a structural summary of a Go source file (package, imports, types, func/method signatures, consts, vars) and single-symbol slicing — via the stdlib go/parser (syntax only, no type-checking), so it works on any file regardless of whether it compiles.
|
Package gocode is the Go backend for `sf code`: a structural summary of a Go source file (package, imports, types, func/method signatures, consts, vars) and single-symbol slicing — via the stdlib go/parser (syntax only, no type-checking), so it works on any file regardless of whether it compiles. |
|
Package phpcode is the PHP backend for `sf code`: a structural summary of a PHP file (namespace, class/interface/trait/enum, extends/implements, attributes, enum cases, constructor deps, properties, method signatures) and single-method slicing.
|
Package phpcode is the PHP backend for `sf code`: a structural summary of a PHP file (namespace, class/interface/trait/enum, extends/implements, attributes, enum cases, constructor deps, properties, method signatures) and single-method slicing. |
|
Package tscode is the TypeScript/Vue backend for `sf code`.
|
Package tscode is the TypeScript/Vue backend for `sf code`. |