document

package
v0.0.0-...-248a208 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Document

type Document struct {
	// Document relative path. To be used for scip.Document
	RelativePath string

	// The occurrence for `package foo` at the top of a Go file.
	//   It could be a definition or a reference, depending on the package structure.
	//   It doesn't get traversed in the same way as other parts of the tree,
	//   so we special case it here. It must get added to the occurences when
	//   creating a visitors.fileVisitor
	PackageOccurrence *scip.Occurrence
	// contains filtered or unexported fields
}

func NewDocument

func NewDocument(
	relative string,
	pkg *packages.Package,
	pkgSymbols *lookup.Package,
) *Document

func (*Document) GetSymbol

func (d *Document) GetSymbol(pos token.Pos) (string, bool)

func (*Document) SetNewSymbol

func (d *Document) SetNewSymbol(
	symbol string,
	parent ast.Node,
	ident *ast.Ident,
)

SetNewSymbol declares a new symbol and tracks it within a Document.

NOTE: Does NOT emit a new occurrence

func (*Document) SetNewSymbolForPos

func (d *Document) SetNewSymbolForPos(
	symbol string,
	parent ast.Node,
	ident *ast.Ident,
	pos token.Pos,
)

SetNewSymbolForPos declares a new symbol and tracks it within a Document but allows for an override of the position. Generally speaking, you should use DeclareNewSymbol instead (since it will calculate the pos for most cases)

NOTE: Does NOT emit a new occurrence

Jump to

Keyboard shortcuts

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