Documentation
¶
Overview ¶
Package refs answers "who defines/uses this symbol across the tree" in one call: a deterministic, word-boundary-matched scan (built on the same walker + matcher infrastructure as internal/common/grep) that labels every hit with its enclosing function/type — the def/use fan `sf grep <symbol>` plus opening each caller by hand would otherwise take. Go gets an AST- accurate enclosing label (internal/common/code/gocode); PHP/TS/TSX/Vue reuse internal/codectx's regex heuristics, the same ones `sf grep` uses.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Ref ¶
type Ref struct {
Kind string `json:"kind"` // "def" | "use"
File string `json:"file"`
Line int `json:"line"`
Col int `json:"col"`
Enclosing string `json:"enclosing,omitempty"`
Text string `json:"text"`
}
Ref is one occurrence of Symbol — a definition or a use.
type Result ¶
type Result struct {
Symbol string `json:"symbol"`
Refs []Ref `json:"refs"`
Defs int `json:"defs"`
Uses int `json:"uses"`
Truncated int `json:"truncated,omitempty"`
Skipped []string `json:"skipped,omitempty"`
}
Result is the whole answer for one symbol. Refs is already capped (defs first, then file, then line); Defs/Uses count the true totals found before capping, and Truncated is how many were dropped.