indexer

package
v1.9.3 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2023 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const NumLockStripes = 512

Variables

This section is empty.

Functions

This section is empty.

Types

type DeclInfo added in v1.7.0

type DeclInfo struct {
	HasDoc bool
	Path   string
}

type DefinitionInfo

type DefinitionInfo struct {
	DocumentID         uint64
	RangeID            uint64
	ResultSetID        uint64
	DefinitionResultID uint64
	ReferenceRangeIDs  map[uint64][]uint64
	TypeSwitchHeader   bool
	// contains filtered or unexported fields
}

DefinitionInfo provides context about a range that defines an identifier. An object of this shape is keyed by type and identifier in the indexer so that it can be re-retrieved for a range that uses the definition.

type DocumentInfo

type DocumentInfo struct {
	DocumentID         uint64
	DefinitionRangeIDs []uint64
	ReferenceRangeIDs  []uint64
	// contains filtered or unexported fields
}

DocumentInfo provides context for constructing the contains relationship between a document and the ranges that it contains.

type GenerationOptions added in v1.7.5

type GenerationOptions struct {
	EnableImplementations bool
	DepBatchSize          int
}

func NewGenerationOptions added in v1.7.5

func NewGenerationOptions() GenerationOptions

type Indexer

type Indexer struct {
	// contains filtered or unexported fields
}

func New

func New(
	repositoryRoot string,
	repositoryRemote string,
	projectRoot string,
	toolInfo protocol.ToolInfo,
	moduleName string,
	moduleVersion string,
	dependencies map[string]gomod.GoModule,
	projectDependencies []string,
	jsonWriter writer.JSONWriter,
	packageDataCache *PackageDataCache,
	outputOptions output.Options,
	generationOptions GenerationOptions,
) *Indexer

func (*Indexer) Index

func (i *Indexer) Index() error

Index generates an LSIF dump from a workspace by traversing through source files and writing the LSIF equivalent to the output source that implements io.Writer. It is caller's responsibility to close the output source if applicable.

func (*Indexer) Stats added in v1.1.0

func (i *Indexer) Stats() IndexerStats

Stats returns an IndexerStats object with the number of packages, files, and elements analyzed/emitted.

type IndexerStats added in v1.1.0

type IndexerStats struct {
	NumPkgs     uint
	NumFiles    uint
	NumDefs     uint
	NumElements uint64
}

IndexerStats summarizes the amount of work done by the indexer.

type ObjectLike added in v1.7.0

type ObjectLike interface {
	Pos() token.Pos
	Pkg() *types.Package
	Name() string
	Type() types.Type
	Exported() bool
	Id() string

	String() string
}

ObjectLike is effectively just types.Object. We needed an interface that we could actually implement since types.Object has unexported fields, so it is unimplementable for our package.

type PackageData added in v1.1.4

type PackageData struct {
	HoverText    map[token.Pos]ast.Node
	MonikerPaths map[token.Pos][]string
	// contains filtered or unexported fields
}

PackageData is a cache of hover text and moniker paths by token position within a package.

type PackageDataCache added in v1.1.4

type PackageDataCache struct {
	// contains filtered or unexported fields
}

PackageDataCache is a cache of hover text and enclosing type identifiers by file and token position.

func NewPackageDataCache added in v1.1.4

func NewPackageDataCache() *PackageDataCache

NewPackageDataCache creates a new empty PackageDataCache.

func (*PackageDataCache) MonikerPath added in v1.1.4

func (l *PackageDataCache) MonikerPath(p *packages.Package, position token.Pos) []string

MonikerPath will return the names of enclosing nodes extracted form the given package for the symbol at the given position. This method will parse the package if the package results haven't been previously calculated or have been evicted from the cache.

func (*PackageDataCache) Stats added in v1.1.4

Stats returns a PackageDataCacheStats object with the number of unique packages traversed.

func (*PackageDataCache) Text added in v1.1.4

func (l *PackageDataCache) Text(p *packages.Package, position token.Pos) string

Text will return the hover text extracted from the given package for the symbol at the given position. This method will parse the package if the package results haven't been previously calculated or have been evicted from the cache.

type PackageDataCacheStats added in v1.1.4

type PackageDataCacheStats struct {
	NumPks uint
}

PackageDataCacheStats summarizes the amount of work done by the package data cache.

type PkgDeclaration added in v1.7.0

type PkgDeclaration struct {
	// contains filtered or unexported fields
}

PkgDeclaration is similar to types.PkgName, except that instead of for _imported_ packages it is for _declared_ packages.

Generated for: `package name`

For more information, see : docs/package_declarations.md

func (PkgDeclaration) Exported added in v1.7.0

func (p PkgDeclaration) Exported() bool

func (PkgDeclaration) Id added in v1.7.0

func (p PkgDeclaration) Id() string

func (PkgDeclaration) Name added in v1.7.0

func (p PkgDeclaration) Name() string

func (PkgDeclaration) Pkg added in v1.7.0

func (p PkgDeclaration) Pkg() *types.Package

func (PkgDeclaration) Pos added in v1.7.0

func (p PkgDeclaration) Pos() token.Pos

func (PkgDeclaration) String added in v1.7.0

func (p PkgDeclaration) String() string

func (PkgDeclaration) Type added in v1.7.0

func (p PkgDeclaration) Type() types.Type

type StripedMutex

type StripedMutex struct {
	// contains filtered or unexported fields
}

func (*StripedMutex) LockKey

func (m *StripedMutex) LockKey(v string)

func (*StripedMutex) RLockKey

func (m *StripedMutex) RLockKey(v string)

func (*StripedMutex) RUnlockKey

func (m *StripedMutex) RUnlockKey(v string)

func (*StripedMutex) UnlockKey

func (m *StripedMutex) UnlockKey(v string)

Jump to

Keyboard shortcuts

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