Documentation
¶
Overview ¶
Package xrefs defines the serializable index of cross-package references that is computed during type checking.
See ../references.go for the 'references' query.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Index ¶
type Index struct {
// contains filtered or unexported fields
}
An Index is an index of outbound symbol references for one specific package.
func Decode ¶ added in v0.22.0
Decode decodes a serialized cross-reference index. It is suitable for use as a filecache.Get decoder.
func NewIndex ¶ added in v0.22.0
func NewIndex(enc *objectpath.Encoder, pkg *types.Package, info *types.Info, files []*parsego.File, asmFiles []*asm.File) *Index
NewIndex constructs an index of outbound cross-references for the specified type-checked package.
Callers indexing many packages should share one objectpath Encoder so that a heavily referenced package's object paths are encoded once rather than once per referencing package.
func (*Index) Lookup ¶ added in v0.22.0
func (idx *Index) Lookup(mp *metadata.Package, targets map[metadata.PackagePath]map[objectpath.Path]struct{}) (locs []protocol.Location)
Lookup searches the index for references to any object in the target set, returning their locations within the package described by mp. Each target object is denoted by a pair of (package path, object path).