gazelle

package
v1.508.0 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2023 License: Apache-2.0 Imports: 9 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.

View Source
var Languages = map[string]*sitter.Language{
	"tsx":        tsx.GetLanguage(),
	"typescript": typescript.GetLanguage(),
}

Supported languages by key

Functions

func NewParser

func NewParser() parser.Parser

Types

type TreeSitterParser

type TreeSitterParser struct {
	parser.Parser
	// contains filtered or unexported fields
}

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