Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterLanguage ¶ added in v0.0.7
func RegisterLanguage(opt LanguageOptions)
RegisterLanguage registers a language with the given extensions. If no queries are provided, the default queries will be used.
Types ¶
type LanguageOptions ¶ added in v0.0.8
type LanguageOptions struct {
Name string
Extensions []string
Language *treesitter.Language
Queries []*treesitter.Query
}
LanguageOptions are treesitter options for a language.
func LanguageFor ¶
func LanguageFor(file string) (*LanguageOptions, bool)
LanguageFor returns the language for the given file name.
type Todo ¶
Todo represents a TODO line.
func ParseCode ¶
func ParseCode(file string, source []byte, opt *LanguageOptions) ([]Todo, error)
ParseCode parses the source code and returns all TODO comments. If lang is nil, the language is inferred from the file extension.
Click to show internal directories.
Click to hide internal directories.