Documentation
¶
Index ¶
- Variables
- func CalculateEdit(start, end ts.Point, oldSrc []byte, newSrc []byte) *ts.InputEdit
- func CalculateNewEndPoint(start ts.Point, src []byte) ts.Point
- func FirstNamedChild(node *ts.Node) *ts.Node
- func FirstNamedChildOfKind(node *ts.Node, kind string) *ts.Node
- func FreeQueryCache()
- func GetInjectionQuery(lang language.Identifier) (*ts.Query, error)
- func GetQuery(langID language.Identifier, name string) (*ts.Query, error)
- func GetRowByte(row uint, src []byte) uint
- func GetTagsQuery(lang language.Identifier) (*ts.Query, error)
- func NamedChildOfKind(node *ts.Node, kind string) *ts.Node
- func PointInRange(p ts.Point, r ts.Range) bool
- func PointToByteOffset(point ts.Point, src []byte) uint
- func RangeOverlap(a ts.Range, b ts.Range) bool
- func RangeOverlapBytes(a ts.Range, b ts.Range) bool
- func ReadQueryFromFile(lang *language.Language, name string) (string, error)
- type Capture
- type CaptureSlice
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrQueryNotFound error = errors.New("query not found")
Functions ¶
func CalculateEdit ¶
Calculate a treesitter InputEdit object.
func CalculateNewEndPoint ¶
Calculate a new endpoint
func FreeQueryCache ¶ added in v0.0.4
func FreeQueryCache()
func GetInjectionQuery ¶ added in v0.0.4
func GetInjectionQuery(lang language.Identifier) (*ts.Query, error)
func GetTagsQuery ¶ added in v0.0.4
func GetTagsQuery(lang language.Identifier) (*ts.Query, error)
func PointInRange ¶
Returns true if point p is inside range r
func PointToByteOffset ¶
Get the byte offset for a point.
func RangeOverlap ¶
Returns true if range a and b overlaps. (calculated using point fields)
func RangeOverlapBytes ¶
Returns true if range a and b overlaps (calculated using byte fields)
Types ¶
type CaptureSlice ¶
type CaptureSlice []Capture
func (CaptureSlice) At ¶
func (captures CaptureSlice) At(position ts.Point) *ts.Node
Find a capture at a given position
func (CaptureSlice) In ¶
func (captures CaptureSlice) In(r ts.Range) []*ts.Node
Find all captures in a given range
func (CaptureSlice) Name ¶ added in v0.0.4
func (captures CaptureSlice) Name(name ...string) CaptureSlice
Find all captures with a given name or names.
Click to show internal directories.
Click to hide internal directories.