Documentation
¶
Overview ¶
Package languages provides language-specific Tree-sitter queries.
Package languages provides language-specific Tree-sitter queries.
Package languages provides language-specific Tree-sitter queries.
Package languages provides language-specific Tree-sitter queries.
Package languages provides language-specific Tree-sitter queries.
Package languages provides language-specific Tree-sitter queries.
Package languages provides language-specific Tree-sitter queries.
Package languages provides language-specific Tree-sitter queries.
Package languages provides language-specific Tree-sitter queries.
Package languages provides language-specific Tree-sitter queries.
Package languages provides language-specific Tree-sitter queries.
Package languages provides language-specific Tree-sitter queries.
Package languages provides language-specific Tree-sitter queries.
Package languages provides language-specific Tree-sitter queries.
Package languages provides language-specific Tree-sitter queries.
Package languages provides language-specific Tree-sitter queries.
Index ¶
- type BaseQuery
- type CQuery
- type CSharpQuery
- type CppQuery
- type ElixirQuery
- type GoQuery
- type JavaQuery
- type KotlinQuery
- type LuaQuery
- type PHPQuery
- type PythonQuery
- type RubyQuery
- type RustQuery
- type SQLQuery
- type ScalaQuery
- type ShellQuery
- type SwiftQuery
- type TOMLQuery
- type TypeScriptQuery
- type YAMLQuery
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaseQuery ¶ added in v0.20.0
type BaseQuery struct{}
BaseQuery provides default implementations for common LanguageQuery methods. Embed this struct to get the default Captures() implementation.
func (BaseQuery) CallQuery ¶ added in v0.20.0
CallQuery returns nil by default (no call extraction support).
func (BaseQuery) Captures ¶ added in v0.20.0
Captures returns the standard capture names used across all language queries.
func (BaseQuery) ImportQuery ¶ added in v0.20.0
ImportQuery returns nil by default (no import extraction support).
func (BaseQuery) IsExported ¶ added in v0.21.0
IsExported returns true for any non-empty name by default. Languages with explicit visibility rules should override this method.
type CQuery ¶
type CQuery struct {
BaseQuery
// contains filtered or unexported fields
}
CQuery implements LanguageQuery for C language.
func (*CQuery) ImportQuery ¶ added in v0.9.0
ImportQuery returns the C import query pattern.
func (*CQuery) IsExported ¶ added in v0.21.0
IsExported returns true if the C signature is not file-local (static).
func (*CQuery) KindMapping ¶
KindMapping returns the mapping from node types to Signature kinds.
type CSharpQuery ¶ added in v0.18.0
type CSharpQuery struct {
BaseQuery
// contains filtered or unexported fields
}
CSharpQuery implements LanguageQuery for C# language.
func NewCSharpQuery ¶ added in v0.18.0
func NewCSharpQuery() *CSharpQuery
NewCSharpQuery creates a new C# language query.
func (*CSharpQuery) ImportQuery ¶ added in v0.18.0
func (q *CSharpQuery) ImportQuery() []byte
ImportQuery returns the C# import query pattern.
func (*CSharpQuery) IsExported ¶ added in v0.21.0
func (q *CSharpQuery) IsExported(name, sigText string) bool
IsExported returns true if the C# signature does not start with a private modifier.
func (*CSharpQuery) KindMapping ¶ added in v0.18.0
func (q *CSharpQuery) KindMapping() map[string]string
KindMapping returns the mapping from node types to Signature kinds.
func (*CSharpQuery) Language ¶ added in v0.18.0
func (q *CSharpQuery) Language() *sitter.Language
Language returns the C# Tree-sitter language.
func (*CSharpQuery) Query ¶ added in v0.18.0
func (q *CSharpQuery) Query() []byte
Query returns the C# query pattern.
type CppQuery ¶ added in v0.10.0
type CppQuery struct {
BaseQuery
// contains filtered or unexported fields
}
CppQuery implements LanguageQuery for C++ language.
func NewCppQuery ¶ added in v0.10.0
func NewCppQuery() *CppQuery
NewCppQuery creates a new C++ language query.
func (*CppQuery) ImportQuery ¶ added in v0.10.0
ImportQuery returns the C++ import query pattern.
func (*CppQuery) IsExported ¶ added in v0.21.0
IsExported returns true if the C++ signature is not file-local (static).
func (*CppQuery) KindMapping ¶ added in v0.10.0
KindMapping returns the mapping from node types to Signature kinds.
type ElixirQuery ¶ added in v0.20.0
type ElixirQuery struct {
BaseQuery
// contains filtered or unexported fields
}
ElixirQuery implements LanguageQuery for Elixir language.
func NewElixirQuery ¶ added in v0.20.0
func NewElixirQuery() *ElixirQuery
NewElixirQuery creates a new Elixir language query.
func (*ElixirQuery) ImportQuery ¶ added in v0.20.0
func (q *ElixirQuery) ImportQuery() []byte
ImportQuery returns the Elixir import query pattern.
func (*ElixirQuery) IsExported ¶ added in v0.21.0
func (q *ElixirQuery) IsExported(name, sigText string) bool
IsExported returns true if the Elixir definition uses def (not defp).
func (*ElixirQuery) KindMapping ¶ added in v0.20.0
func (q *ElixirQuery) KindMapping() map[string]string
KindMapping returns the mapping from node types to Signature kinds. Elixir uses generic node types (call, unary_operator) which are refined on the Go side in parser.go based on the signature text.
func (*ElixirQuery) Language ¶ added in v0.20.0
func (q *ElixirQuery) Language() *sitter.Language
Language returns the Elixir Tree-sitter language.
func (*ElixirQuery) Query ¶ added in v0.20.0
func (q *ElixirQuery) Query() []byte
Query returns the Elixir query pattern.
type GoQuery ¶
type GoQuery struct {
BaseQuery
// contains filtered or unexported fields
}
GoQuery implements LanguageQuery for Go language.
func (*GoQuery) ImportQuery ¶ added in v0.9.0
ImportQuery returns the Go import query pattern.
func (*GoQuery) IsExported ¶ added in v0.21.0
IsExported returns true if the Go identifier starts with an uppercase letter.
func (*GoQuery) KindMapping ¶
KindMapping returns the mapping from node types to Signature kinds.
type JavaQuery ¶ added in v0.7.0
type JavaQuery struct {
BaseQuery
// contains filtered or unexported fields
}
JavaQuery implements LanguageQuery for Java language.
func NewJavaQuery ¶ added in v0.7.0
func NewJavaQuery() *JavaQuery
NewJavaQuery creates a new Java language query.
func (*JavaQuery) ImportQuery ¶ added in v0.9.0
ImportQuery returns the Java import query pattern.
func (*JavaQuery) IsExported ¶ added in v0.21.0
IsExported returns true if the Java signature does not start with a private modifier.
func (*JavaQuery) KindMapping ¶ added in v0.7.0
KindMapping returns the mapping from node types to Signature kinds.
type KotlinQuery ¶ added in v0.17.0
type KotlinQuery struct {
BaseQuery
// contains filtered or unexported fields
}
KotlinQuery implements LanguageQuery for Kotlin language.
func NewKotlinQuery ¶ added in v0.17.0
func NewKotlinQuery() *KotlinQuery
NewKotlinQuery creates a new Kotlin language query.
func (*KotlinQuery) ImportQuery ¶ added in v0.17.0
func (q *KotlinQuery) ImportQuery() []byte
ImportQuery returns the Kotlin import query pattern.
func (*KotlinQuery) IsExported ¶ added in v0.21.0
func (q *KotlinQuery) IsExported(name, sigText string) bool
IsExported returns true if the Kotlin signature does not start with a private modifier.
func (*KotlinQuery) KindMapping ¶ added in v0.17.0
func (q *KotlinQuery) KindMapping() map[string]string
KindMapping returns the mapping from node types to Signature kinds.
func (*KotlinQuery) Language ¶ added in v0.17.0
func (q *KotlinQuery) Language() *sitter.Language
Language returns the Kotlin Tree-sitter language.
func (*KotlinQuery) Query ¶ added in v0.17.0
func (q *KotlinQuery) Query() []byte
Query returns the Kotlin query pattern.
type LuaQuery ¶ added in v0.19.0
type LuaQuery struct {
BaseQuery
// contains filtered or unexported fields
}
LuaQuery implements LanguageQuery for Lua language.
func NewLuaQuery ¶ added in v0.19.0
func NewLuaQuery() *LuaQuery
NewLuaQuery creates a new Lua language query.
func (*LuaQuery) ImportQuery ¶ added in v0.19.0
ImportQuery returns the Lua import query pattern.
func (*LuaQuery) KindMapping ¶ added in v0.19.0
KindMapping returns the mapping from node types to Signature kinds.
type PHPQuery ¶ added in v0.19.0
type PHPQuery struct {
BaseQuery
// contains filtered or unexported fields
}
PHPQuery implements LanguageQuery for PHP language.
func NewPHPQuery ¶ added in v0.19.0
func NewPHPQuery() *PHPQuery
NewPHPQuery creates a new PHP language query.
func (*PHPQuery) ImportQuery ¶ added in v0.19.0
ImportQuery returns the PHP import query pattern.
func (*PHPQuery) IsExported ¶ added in v0.21.0
IsExported returns true if the PHP signature does not start with a private modifier.
func (*PHPQuery) KindMapping ¶ added in v0.19.0
KindMapping returns the mapping from node types to Signature kinds.
type PythonQuery ¶
type PythonQuery struct {
BaseQuery
// contains filtered or unexported fields
}
PythonQuery implements LanguageQuery for Python language.
func NewPythonQuery ¶
func NewPythonQuery() *PythonQuery
NewPythonQuery creates a new Python language query.
func (*PythonQuery) CallQuery ¶ added in v0.20.0
func (q *PythonQuery) CallQuery() []byte
CallQuery returns the Python call query pattern.
func (*PythonQuery) ImportQuery ¶ added in v0.9.0
func (q *PythonQuery) ImportQuery() []byte
ImportQuery returns the Python import query pattern.
func (*PythonQuery) IsExported ¶ added in v0.21.0
func (q *PythonQuery) IsExported(name, _ string) bool
IsExported returns true if the Python name does not start with underscore. Single underscore prefix (_name) is a convention for internal/private symbols.
func (*PythonQuery) KindMapping ¶
func (q *PythonQuery) KindMapping() map[string]string
KindMapping returns the mapping from node types to Signature kinds.
func (*PythonQuery) Language ¶
func (q *PythonQuery) Language() *sitter.Language
Language returns the Python Tree-sitter language.
func (*PythonQuery) Query ¶
func (q *PythonQuery) Query() []byte
Query returns the Python query pattern.
type RubyQuery ¶ added in v0.19.0
type RubyQuery struct {
BaseQuery
// contains filtered or unexported fields
}
RubyQuery implements LanguageQuery for Ruby language.
func NewRubyQuery ¶ added in v0.19.0
func NewRubyQuery() *RubyQuery
NewRubyQuery creates a new Ruby language query.
func (*RubyQuery) ImportQuery ¶ added in v0.19.0
ImportQuery returns the Ruby import query pattern.
func (*RubyQuery) KindMapping ¶ added in v0.19.0
KindMapping returns the mapping from node types to Signature kinds.
type RustQuery ¶ added in v0.14.0
type RustQuery struct {
BaseQuery
// contains filtered or unexported fields
}
RustQuery implements LanguageQuery for Rust language.
func NewRustQuery ¶ added in v0.14.0
func NewRustQuery() *RustQuery
NewRustQuery creates a new Rust language query.
func (*RustQuery) ImportQuery ¶ added in v0.14.0
ImportQuery returns the Rust import query pattern.
func (*RustQuery) IsExported ¶ added in v0.21.0
IsExported returns true for Rust items. In Rust, items without `pub` are still crate-visible, which is exported enough for project-level analysis. Only items explicitly marked with restricted visibility (e.g., inside impl blocks) would be truly private, but that requires AST context beyond sigText.
func (*RustQuery) KindMapping ¶ added in v0.14.0
KindMapping returns the mapping from node types to Signature kinds.
type SQLQuery ¶ added in v0.20.0
type SQLQuery struct {
BaseQuery
// contains filtered or unexported fields
}
SQLQuery implements LanguageQuery for SQL language.
func NewSQLQuery ¶ added in v0.20.0
func NewSQLQuery() *SQLQuery
NewSQLQuery creates a new SQL language query.
func (*SQLQuery) ImportQuery ¶ added in v0.20.0
ImportQuery returns nil since SQL has no import system.
func (*SQLQuery) KindMapping ¶ added in v0.20.0
KindMapping returns the mapping from SQL DDL node types to Signature kinds.
type ScalaQuery ¶ added in v0.19.0
type ScalaQuery struct {
BaseQuery
// contains filtered or unexported fields
}
ScalaQuery implements LanguageQuery for Scala language.
func NewScalaQuery ¶ added in v0.19.0
func NewScalaQuery() *ScalaQuery
NewScalaQuery creates a new Scala language query.
func (*ScalaQuery) ImportQuery ¶ added in v0.19.0
func (q *ScalaQuery) ImportQuery() []byte
ImportQuery returns the Scala import query pattern.
func (*ScalaQuery) IsExported ¶ added in v0.21.0
func (q *ScalaQuery) IsExported(name, sigText string) bool
IsExported returns true if the Scala signature does not start with a private modifier.
func (*ScalaQuery) KindMapping ¶ added in v0.19.0
func (q *ScalaQuery) KindMapping() map[string]string
KindMapping returns the mapping from node types to Signature kinds.
func (*ScalaQuery) Language ¶ added in v0.19.0
func (q *ScalaQuery) Language() *sitter.Language
Language returns the Scala Tree-sitter language.
func (*ScalaQuery) Query ¶ added in v0.19.0
func (q *ScalaQuery) Query() []byte
Query returns the Scala query pattern.
type ShellQuery ¶ added in v0.19.0
type ShellQuery struct {
BaseQuery
// contains filtered or unexported fields
}
ShellQuery implements LanguageQuery for Shell/Bash language.
func NewShellQuery ¶ added in v0.19.0
func NewShellQuery() *ShellQuery
NewShellQuery creates a new Shell/Bash language query.
func (*ShellQuery) ImportQuery ¶ added in v0.19.0
func (q *ShellQuery) ImportQuery() []byte
ImportQuery returns the Shell/Bash import query pattern.
func (*ShellQuery) KindMapping ¶ added in v0.19.0
func (q *ShellQuery) KindMapping() map[string]string
KindMapping returns the mapping from node types to Signature kinds.
func (*ShellQuery) Language ¶ added in v0.19.0
func (q *ShellQuery) Language() *sitter.Language
Language returns the Shell/Bash Tree-sitter language.
func (*ShellQuery) Query ¶ added in v0.19.0
func (q *ShellQuery) Query() []byte
Query returns the Shell/Bash query pattern.
type SwiftQuery ¶ added in v0.16.0
type SwiftQuery struct {
BaseQuery
// contains filtered or unexported fields
}
SwiftQuery implements LanguageQuery for Swift language.
func NewSwiftQuery ¶ added in v0.16.0
func NewSwiftQuery() *SwiftQuery
NewSwiftQuery creates a new Swift language query.
func (*SwiftQuery) ImportQuery ¶ added in v0.16.0
func (q *SwiftQuery) ImportQuery() []byte
ImportQuery returns the Swift import query pattern.
func (*SwiftQuery) IsExported ¶ added in v0.21.0
func (q *SwiftQuery) IsExported(name, sigText string) bool
IsExported returns true if the Swift signature does not start with a private modifier.
func (*SwiftQuery) KindMapping ¶ added in v0.16.0
func (q *SwiftQuery) KindMapping() map[string]string
KindMapping returns the mapping from node types to Signature kinds.
func (*SwiftQuery) Language ¶ added in v0.16.0
func (q *SwiftQuery) Language() *sitter.Language
Language returns the Swift Tree-sitter language.
func (*SwiftQuery) Query ¶ added in v0.16.0
func (q *SwiftQuery) Query() []byte
Query returns the Swift query pattern.
type TOMLQuery ¶ added in v0.20.0
type TOMLQuery struct {
BaseQuery
// contains filtered or unexported fields
}
TOMLQuery implements LanguageQuery for TOML language.
func NewTOMLQuery ¶ added in v0.20.0
func NewTOMLQuery() *TOMLQuery
NewTOMLQuery creates a new TOML language query.
func (*TOMLQuery) ImportQuery ¶ added in v0.20.0
ImportQuery returns nil since TOML has no import system.
func (*TOMLQuery) KindMapping ¶ added in v0.20.0
KindMapping returns the mapping from TOML node types to Signature kinds.
type TypeScriptQuery ¶
type TypeScriptQuery struct {
BaseQuery
// contains filtered or unexported fields
}
TypeScriptQuery implements LanguageQuery for TypeScript language.
func NewTypeScriptQuery ¶
func NewTypeScriptQuery() *TypeScriptQuery
NewTypeScriptQuery creates a new TypeScript language query.
func (*TypeScriptQuery) CallQuery ¶ added in v0.20.0
func (q *TypeScriptQuery) CallQuery() []byte
CallQuery returns the TypeScript call query pattern.
func (*TypeScriptQuery) ImportQuery ¶ added in v0.9.0
func (q *TypeScriptQuery) ImportQuery() []byte
ImportQuery returns the TypeScript import query pattern.
func (*TypeScriptQuery) KindMapping ¶
func (q *TypeScriptQuery) KindMapping() map[string]string
KindMapping returns the mapping from node types to Signature kinds.
func (*TypeScriptQuery) Language ¶
func (q *TypeScriptQuery) Language() *sitter.Language
Language returns the TypeScript Tree-sitter language.
func (*TypeScriptQuery) Query ¶
func (q *TypeScriptQuery) Query() []byte
Query returns the TypeScript query pattern.
type YAMLQuery ¶ added in v0.20.0
type YAMLQuery struct {
BaseQuery
// contains filtered or unexported fields
}
YAMLQuery implements LanguageQuery for YAML language.
func NewYAMLQuery ¶ added in v0.20.0
func NewYAMLQuery() *YAMLQuery
NewYAMLQuery creates a new YAML language query.
func (*YAMLQuery) ImportQuery ¶ added in v0.20.0
ImportQuery returns nil since YAML has no import system.
func (*YAMLQuery) KindMapping ¶ added in v0.20.0
KindMapping returns the mapping from YAML node types to Signature kinds.