gazelle

package
v1.509.7 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

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.

Functions

func NewParser

func NewParser() parser.Parser

Types

type TreeSitterParser

type TreeSitterParser struct {
	parser.Parser
}

func (*TreeSitterParser) ParseSource added in v1.508.0

func (p *TreeSitterParser) ParseSource(filePath, sourceCodeStr string) (parser.ParseResult, []error)

Jump to

Keyboard shortcuts

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