providers

package
v0.0.0-...-e49a3f0 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2023 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefineExpr

func DefineExpr(ctx *context.Ctx) ([]*definition.Definition, error)

Types

type ClassConstantProvider

type ClassConstantProvider struct{}

ClassConstantProvider resolves the definition of a class constant, Foo::BAR.

func NewClassConstant

func NewClassConstant() *ClassConstantProvider

func (*ClassConstantProvider) CanDefine

func (p *ClassConstantProvider) CanDefine(ctx *context.Ctx, kind ast.Type) bool

func (*ClassConstantProvider) Define

type CommentsProvider

type CommentsProvider struct{}

func NewComments

func NewComments() *CommentsProvider

func (*CommentsProvider) CanDefine

func (p *CommentsProvider) CanDefine(ctx *context.Ctx, _ ast.Type) bool

func (*CommentsProvider) Define

func (p *CommentsProvider) Define(ctx *context.Ctx) ([]*definition.Definition, error)

type ConstantProvider

type ConstantProvider struct{}

ConstantProvider resolves the definition of constant fetches.

func NewConstant

func NewConstant() *ConstantProvider

func (*ConstantProvider) CanDefine

func (c *ConstantProvider) CanDefine(ctx *context.Ctx, kind ast.Type) bool

func (*ConstantProvider) Define

func (c *ConstantProvider) Define(ctx *context.Ctx) ([]*definition.Definition, error)

TODO: return non-array.

type FunctionProvider

type FunctionProvider struct{}

FunctionProvider resolves the definition of a function call. It first looks for it in the current scope (a local function declaration). if it can't find it, the function will be looked for in the global scope.

func NewFunction

func NewFunction() *FunctionProvider

func (*FunctionProvider) CanDefine

func (p *FunctionProvider) CanDefine(ctx *context.Ctx, kind ast.Type) bool

func (*FunctionProvider) Define

func (p *FunctionProvider) Define(ctx *context.Ctx) ([]*definition.Definition, error)

type MethodProvider

type MethodProvider struct{}

MethodProvider resolves the definition of a method call. $this->test(), $this->test->test(), $foo->bar() etc. for example.

func NewMethod

func NewMethod() *MethodProvider

func (*MethodProvider) CanDefine

func (p *MethodProvider) CanDefine(ctx *context.Ctx, kind ast.Type) bool

func (*MethodProvider) Define

func (p *MethodProvider) Define(ctx *context.Ctx) ([]*definition.Definition, error)

type NameProvider

type NameProvider struct{}

NameProvider resolves the definition of a class-like name. This defines the name part of 'new Name()', 'Name::method()', 'extends Name' etc.

func NewName

func NewName() *NameProvider

func (*NameProvider) CanDefine

func (p *NameProvider) CanDefine(ctx *context.Ctx, kind ast.Type) bool

func (*NameProvider) Define

func (p *NameProvider) Define(ctx *context.Ctx) ([]*definition.Definition, error)

TODO: use DefineExpr.

type PropertyProvider

type PropertyProvider struct{}

PropertyProvider resolves the definition of a property accessed like $a->property. Where $a can also be $this, $a->foo->bar()->property etc.

func NewProperty

func NewProperty() *PropertyProvider

func (*PropertyProvider) CanDefine

func (p *PropertyProvider) CanDefine(ctx *context.Ctx, kind ast.Type) bool

func (*PropertyProvider) Define

func (p *PropertyProvider) Define(ctx *context.Ctx) ([]*definition.Definition, error)

type StaticProvider

type StaticProvider struct{}

StaticProvider provides definitions for static method calls like Foo::bar().

func NewStatic

func NewStatic() *StaticProvider

func (*StaticProvider) CanDefine

func (p *StaticProvider) CanDefine(ctx *context.Ctx, kind ast.Type) bool

func (*StaticProvider) Define

func (p *StaticProvider) Define(ctx *context.Ctx) ([]*definition.Definition, error)

type ThisProvider

type ThisProvider struct{}

ThisProvider resolves the definition of the current class scope for '$this' variables.

func NewThis

func NewThis() *ThisProvider

func (*ThisProvider) CanDefine

func (p *ThisProvider) CanDefine(ctx *context.Ctx, kind ast.Type) bool

func (*ThisProvider) Define

func (p *ThisProvider) Define(ctx *context.Ctx) ([]*definition.Definition, error)

TODO: use DefineExpr. TODO: merge with variable provider.

type UseProvider

type UseProvider struct{}

UseProvider resolves the definition of 'use Foo/Bar/FooBar' statements. It is a separate provider than the NameProvider because the NameProvider will resolve any alias, in this case we want the source of the alias instead.

func NewUse

func NewUse() *UseProvider

func (*UseProvider) CanDefine

func (p *UseProvider) CanDefine(ctx *context.Ctx, kind ast.Type) bool

func (*UseProvider) Define

func (p *UseProvider) Define(ctx *context.Ctx) ([]*definition.Definition, error)

type VariableProvider

type VariableProvider struct{}

VariableProvider resolves the definition of a simple variable. It looks for it being assigned, as a parameter, or a global.

func NewVariable

func NewVariable() *VariableProvider

func (*VariableProvider) CanDefine

func (p *VariableProvider) CanDefine(ctx *context.Ctx, kind ast.Type) bool

func (*VariableProvider) Define

func (p *VariableProvider) Define(ctx *context.Ctx) ([]*definition.Definition, error)

TODO: use DefineExpr.

Jump to

Keyboard shortcuts

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