Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNotSupported = errors.New("language is not supported")
Functions ¶
This section is empty.
Types ¶
type Identifier ¶
type Identifier string
Identifier is a type that uniquely identifies a language
const ( HTML Identifier = "html" PHP Identifier = "php" PHPOnly Identifier = "php_only" Blade Identifier = "blade" DotEnv Identifier = "dotenv" )
const InvalidIdentifier Identifier = "invalid"
InvalidIdentifier special identifier that is used to flag that the language is invalid.
func FiletypeToLanguage ¶
func FiletypeToLanguage(t file.Type) Identifier
FiletypeToLanguage Get the language Identifier for a particular filetype
func (Identifier) Language ¶
func (id Identifier) Language() *Language
Language get the language object for this identifier Syntactic sugar for Get(id)
func (Identifier) String ¶
func (id Identifier) String() string
String syntactic sugar for string(id)
func (Identifier) Valid ¶
func (id Identifier) Valid() bool
type Language ¶
type Language struct {
// contains filtered or unexported fields
}
Language is a wrapper object that makes is easier to handle tree-sitter language objects.
func Get ¶
func Get(lang Identifier) *Language
func NewLanguage ¶
func NewLanguage(id Identifier, impl unsafe.Pointer) *Language
Click to show internal directories.
Click to hide internal directories.