depsusage

package
v0.0.0-...-3200512 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2026 License: Apache-2.0 Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDependencyUsagePlugin

func NewDependencyUsagePlugin(usageCallback DependencyUsageCallback) *dependencyUsagePlugin

depsusage plugin collects the usage evidence for the imported dependencies. It uses tree-sitter to parse the imported dependency-identifier relations in the source code and verify the usage of dependencies based on identifier usage.

Types

type DependencyUsageCallback

type DependencyUsageCallback core.PluginCallback[*UsageEvidence]

type UsageEvidence

type UsageEvidence struct {
	PackageHint string // PackageHint: A hint of what could be the package containing this module

	// ModuleName: The module name taken directly from the ImportNode
	ModuleName string

	// The imported item name taken directly from the ImportNode
	ModuleItem string

	// The import alias name taken directly from the ImportNode
	ModuleAlias string

	// Whether the usage is a wildcard usage
	IsWildCardUsage bool

	// The identifier which led to this usage evidence
	Identifier string

	// File path where the usage was found
	FilePath string

	// Line number where the usage was found
	Line uint
}

UsageEvidence represents the evidence of usage of a module item in a file

func (*UsageEvidence) String

func (e *UsageEvidence) String() string

Jump to

Keyboard shortcuts

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