resolution

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2022 License: Apache-2.0 Imports: 6 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Importer

type Importer interface {
	AddImport(pkgName, location string) string
}

type Locator

type Locator struct {
	// contains filtered or unexported fields
}

func NewLocator

func NewLocator() *Locator

func (*Locator) FindIdentType

func (l *Locator) FindIdentType(context *LocatorContext, ref *ast.Ident) (TypeDiscovery, error)

func (*Locator) FindSelectorType

func (l *Locator) FindSelectorType(context *LocatorContext, ref *ast.SelectorExpr) (TypeDiscovery, error)

type LocatorContext

type LocatorContext struct {
	// contains filtered or unexported fields
}

func NewASTFileLocatorContext

func NewASTFileLocatorContext(astFile *ast.File, location string) *LocatorContext

func NewSingleLocationContext

func NewSingleLocationContext(location string) *LocatorContext

func (*LocatorContext) AliasedLocation

func (c *LocatorContext) AliasedLocation(alias string) (string, bool)

func (*LocatorContext) CandidateLocations

func (c *LocatorContext) CandidateLocations(alias string) []string

func (*LocatorContext) LocalLocations

func (c *LocatorContext) LocalLocations() []string

func (*LocatorContext) NonLocalNonAliasedLocations

func (c *LocatorContext) NonLocalNonAliasedLocations(alias string) []string

type Resolver

type Resolver struct {
	// contains filtered or unexported fields
}

func NewResolver

func NewResolver(importer Importer, locator *Locator) *Resolver

func (*Resolver) ResolveType

func (r *Resolver) ResolveType(context *LocatorContext, astType ast.Expr) (ast.Expr, error)

type TypeDiscovery

type TypeDiscovery struct {
	Location string
	File     *ast.File
	Spec     *ast.TypeSpec
}

type TypeNotFoundError

type TypeNotFoundError struct {
	Name string
}

func (*TypeNotFoundError) Error

func (e *TypeNotFoundError) Error() string

Jump to

Keyboard shortcuts

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