common

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeclarationBasedComponentResolution

func DeclarationBasedComponentResolution(r *file.Results) string

func DirectoryBasedComponentResolution

func DirectoryBasedComponentResolution(r *file.Results) string

Types

type ComponentResolutionFunc

type ComponentResolutionFunc func(r *file.Results) string

func GetComponentResolutionFromTemplate

func GetComponentResolutionFromTemplate(template *LanguagePackTemplate) ComponentResolutionFunc

type LanguagePack

type LanguagePack struct {
	FileGlob            glob.Glob
	Language            *sitter.Language
	Queries             []*sitter.Query
	ComponentResolution ComponentResolutionFunc
	SnippetTransformers map[string]func(*file.Snippet) *file.Snippet
}

func PackFromTemplate

func PackFromTemplate(template *LanguagePackTemplate) (*LanguagePack, error)

func (*LanguagePack) AnalyzeFile

func (lp *LanguagePack) AnalyzeFile(f file.File) *file.Results

AnalyzeFile analyzes a file and returns the results. Snippets (which are just tree-sitter capture groups) starting with an underscore are only used for stats, and are not recorded as snippets.

func (*LanguagePack) AnalyzeFileContent

func (lp *LanguagePack) AnalyzeFileContent(path string, content []byte) *file.Results

type LanguagePackTemplate

type LanguagePackTemplate struct {
	FileGlob            string
	Language            *sitter.Language
	Queries             []string
	ComponentResolution ComponentResolutionFunc
	SnippetTransformers map[string]func(*file.Snippet) *file.Snippet
}

Jump to

Keyboard shortcuts

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