code

package
v3.9.1 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2024 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Comment

type Comment struct {
	Text   string
	Source string
	Line   int
	Offset int
	Scope  string
}

Comment represents an in-code comment (line or block).

func GetComments

func GetComments(source []byte, lang *Language) ([]Comment, error)

GetComments returns all comments in the given source code.

type Language

type Language struct {
	Delims  *regexp.Regexp
	Parser  *sitter.Language
	Queries []string
	Cutset  string
	Padding padding
}

Language represents a supported programming language.

NOTE: What about haskell, less, perl, php, powershell, r, sass, swift?

func C

func C() *Language

func CSS

func CSS() *Language

func Cpp

func Cpp() *Language

func GetLanguageFromExt

func GetLanguageFromExt(ext string) (*Language, error)

GetLanguageFromExt returns a Language based on the given file extension.

func Go

func Go() *Language

func JavaScript

func JavaScript() *Language

func Julia added in v3.7.1

func Julia() *Language

func Protobuf

func Protobuf() *Language

func Python

func Python() *Language

func Ruby

func Ruby() *Language

func Rust

func Rust() *Language

func Tsx

func Tsx() *Language

func TypeScript

func TypeScript() *Language

func YAML

func YAML() *Language

type QueryEngine

type QueryEngine struct {
	// contains filtered or unexported fields
}

func NewQueryEngine

func NewQueryEngine(tree *sitter.Tree, lang *Language) *QueryEngine

Jump to

Keyboard shortcuts

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