treesitter

package
v1.509.25 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrorsQuery = `(ERROR) @error`

Functions

func GetNodeChildByType added in v1.508.0

func GetNodeChildByType(node *sitter.Node, childType string) *sitter.Node

func GetNodeChildByTypePath added in v1.508.0

func GetNodeChildByTypePath(node *sitter.Node, childPath ...string) *sitter.Node

func GetNodeStringField added in v1.508.0

func GetNodeStringField(node *sitter.Node, name string) *sitter.Node

func ParseQuery

func ParseQuery(lang Language, queryStr string) *sitter.Query

func ParseSourceCode added in v1.509.7

func ParseSourceCode(lang Language, sourceCode []byte) (*sitter.Tree, error)

func QueryErrors

func QueryErrors(lang Language, sourceCode []byte, node *sitter.Node) []error

Create an error for each parse error.

func QueryStrings added in v1.509.7

func QueryStrings(query *sitter.Query, name string, sourcePath string, sourceCode []byte, rootNode *sitter.Node) []string

Run a query finding import query matches.

Types

type Language added in v1.509.7

type Language = int
const (
	Kotlin Language = iota
	Typescript
	TypescriptX
)

Jump to

Keyboard shortcuts

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