index

package
v0.0.0-...-e49a3f0 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2023 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound = fmt.Errorf(errNotFoundFmt, "", "")
	ErrParse    = fmt.Errorf(errParseFmt, "", nil)
	Current     Index
)

Functions

This section is empty.

Types

type INode

type INode struct {
	FQN        *fqn.FQN
	Path       string
	Position   *position.Position
	Identifier string
	Kind       ast.Type
}

func NewINode

func NewINode(fqns *fqn.FQN, path string, node ast.Vertex) *INode

func (*INode) MatchesKind

func (i *INode) MatchesKind(kinds ...ast.Type) bool

func (*INode) ToIRNode

func (i *INode) ToIRNode(root *ast.Root) ast.Vertex

type INodeTraverser

type INodeTraverser struct {
	visitor.Null
	// contains filtered or unexported fields
}

func NewIndexTraverser

func NewIndexTraverser() *INodeTraverser

func (*INodeTraverser) EnterNode

func (t *INodeTraverser) EnterNode(node ast.Vertex) bool

func (*INodeTraverser) LeaveNode

func (t *INodeTraverser) LeaveNode(node ast.Vertex)

func (*INodeTraverser) Reset

func (t *INodeTraverser) Reset(path string, nodes chan<- *INode)

type Index

type Index interface {
	Index(path string, content string) error

	Refresh(path string, content string) error

	Delete(path string) error

	// Finds a symbol with the given FQN matching the given node kinds.
	// The given namespace must be fully qualified.
	//
	// Giving this no kinds or ir.KindRoot will return any kind.
	Find(key *fqn.FQN) (*INode, bool)

	// Finds a prefix/completes a string.
	// Do not call this with a namespaced symbol, only the class or function name.
	//
	// Giving this no kinds will return any kind.
	// A max of 0 or passing ir.KindRoot will return everything.
	FindPrefix(prefix string, max int, kind ...ast.Type) []*INode

	FindFqnPrefix(prefix string, max int, kind ...ast.Type) []*INode
}

func New

func New(phpv *phpversion.PHPVersion) Index

Jump to

Keyboard shortcuts

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