Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ImportQueries = []string{
`
(call_expression
function: (import)
arguments: (
arguments (
string (string_fragment) @from
)
)
)
`,
`
(call_expression
function: (identifier) @equals-require
arguments: (
arguments (
string (string_fragment) @from
)
)
(#eq? @equals-require "require")
)
`,
}
Queries finding import statements, tagging such Nodes as 'from' captures. Optionally filtering captures using 'equals-{name}' vars and #eq? statements.
View Source
var Languages = map[string]*sitter.Language{ "tsx": tsx.GetLanguage(), "typescript": typescript.GetLanguage(), }
Supported languages by key
Functions ¶
Types ¶
type TreeSitterParser ¶
func (*TreeSitterParser) ParseSource ¶ added in v1.508.0
func (p *TreeSitterParser) ParseSource(filePath, sourceCodeStr string) (parser.ParseResult, []error)
Click to show internal directories.
Click to hide internal directories.