Documentation
¶
Index ¶
- func Collect[T any](f NextFunc[T]) []T
- func FirstAncestorOfType(node *sitter.Node, ptype string) *sitter.Node
- func NodeContentEquals(node *sitter.Node, src []byte, s string) bool
- func NodeContentRegex(node *sitter.Node, src []byte, regex *regexp.Regexp) bool
- func NodeContentStartWith(node *sitter.Node, src []byte, s string) bool
- type AllOf
- type Cache
- type HasContent
- type HasParent
- type Is
- type MatchNodes
- type NextFunc
- type NextMatchFunc
- type Param
- type Predicate
- type Reference
- type Selector
- type Type
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NodeContentRegex ¶
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
Cache stores queries by language ID in a threadsafe manner
type HasContent ¶
type HasContent string
type MatchNodes ¶
type NextFunc ¶
func SelectIf ¶
func SelectIf[T any](source []byte, query NextFunc[MatchNodes], selector Selector[T], predicate Predicate[MatchNodes]) NextFunc[T]
type NextMatchFunc ¶
type NextMatchFunc = NextFunc[MatchNodes]
func Exec ¶
func Exec(lang core.SourceLanguage, c *sitter.Node, q string) NextMatchFunc
Exec returns a function that acts as an iterator, each call will loop over the next match lazily and populate the results map with a mapping of field name as defined in the query to mapped node.
type Reference ¶
type Reference struct {
File *core.SourceFile
QueryResult map[string]*sitter.Node
}
func FindReferencesInFile ¶
func FindReferencesInFile( file *core.SourceFile, matchRefQuery string, validate func(map[string]*sitter.Node, *core.SourceFile) bool, ) []Reference
func FindReferencesInUnit ¶
func FindReferencesInUnit( lang *core.SourceLanguage, unit *core.ExecutionUnit, matchRefQuery string, validate func(map[string]*sitter.Node, *core.SourceFile) bool, ) []Reference
Click to show internal directories.
Click to hide internal directories.