extraction

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractGoImports

func ExtractGoImports(ctx context.Context, content []byte) []string

ExtractGoImports extracts import paths from Go source using tree-sitter. Handles both single imports and grouped import blocks.

func ExtractJSImports

func ExtractJSImports(_ context.Context, content []byte) []string

func MatchPatternExcludingComments added in v1.1.1

func MatchPatternExcludingComments(ctx context.Context, content []byte, pattern *regexp.Regexp) bool

MatchPatternExcludingComments checks if pattern matches content after stripping comments. Uses tree-sitter TypeScript parser (handles JS too) to accurately identify comment nodes, avoiding false positives from comment-like patterns inside string literals (e.g., "**/*.ts"). Falls back to regex-based stripping if tree-sitter parsing fails.

Types

This section is empty.

Jump to

Keyboard shortcuts

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