Documentation ¶
Index ¶
- Constants
- Variables
- func DeprecatedDiagnostics(ctx ResolveContext) []protocol.Diagnostic
- func GetClassFQNLowerCase(fqn string) string
- func GetParserDiagnostics(document *Document) []protocol.Diagnostic
- func GetScopeAndNameFromString(name string) (string, string)
- func IsFQN(name string) bool
- func IsInherited(currentClass string, access MemberAccess, relationMap RelationMap, ...) bool
- func IsInheritedStatic(currentClass string, access MemberAccess, relationMap RelationMap, ...) bool
- func IsNameParent(name string) bool
- func IsNameRelative(name string) bool
- func SymToRefs(document *Document, sym HasTypes) []string
- func TraverseDocument(document *Document, preorder func(Symbol), postorder func(Symbol))
- func TraverseSymbol(s Symbol, preorder func(Symbol), postorder func(Symbol))
- func UnusedDiagnostics(document *Document) []protocol.Diagnostic
- type AnonymousFunction
- type ArgumentList
- type BlockSymbol
- type Class
- func (s *Class) AddUse(name TypeString)
- func (s *Class) GetChildren() []Symbol
- func (s *Class) GetCollection() string
- func (s *Class) GetDescription() string
- func (s *Class) GetIndexCollection() string
- func (s *Class) GetIndexableName() string
- func (s *Class) GetKey() string
- func (s *Class) GetLocation() protocol.Location
- func (s *Class) GetName() string
- func (s *Class) GetScope() string
- func (s *Class) IsScopeSymbol() bool
- func (s *Class) ReferenceFQN() string
- func (s *Class) ReferenceLocation() protocol.Location
- func (s *Class) Serialise(e *storage.Encoder)
- type ClassAccess
- type ClassConst
- func (s *ClassConst) GetCollection() string
- func (s *ClassConst) GetDescription() string
- func (s *ClassConst) GetIndexCollection() string
- func (s *ClassConst) GetIndexableName() string
- func (s *ClassConst) GetKey() string
- func (s *ClassConst) GetLocation() protocol.Location
- func (s *ClassConst) GetName() string
- func (s *ClassConst) GetScope() string
- func (s *ClassConst) IsScopeSymbol() bool
- func (s *ClassConst) IsStatic() bool
- func (s *ClassConst) ReferenceFQN() string
- func (s *ClassConst) ReferenceLocation() protocol.Location
- func (s *ClassConst) ScopeTypeString() TypeString
- func (s *ClassConst) Serialise(e *storage.Encoder)
- func (s *ClassConst) Visibility() VisibilityModifierValue
- type ClassConstWithScope
- type ClassModifierValue
- type ClassTypeDesignator
- type CompletionValue
- type Const
- func (s *Const) GetCollection() string
- func (s *Const) GetDescription() string
- func (s *Const) GetIndexCollection() string
- func (s *Const) GetIndexableName() string
- func (s *Const) GetKey() string
- func (s *Const) GetLocation() protocol.Location
- func (s *Const) GetName() string
- func (s *Const) Serialise(e *storage.Encoder)
- type ConstantAccess
- type Define
- func (s *Define) GetChildren() []Symbol
- func (s *Define) GetCollection() string
- func (s *Define) GetDescription() string
- func (s *Define) GetIndexCollection() string
- func (s *Define) GetIndexableName() string
- func (s *Define) GetKey() string
- func (s *Define) GetLocation() protocol.Location
- func (s *Define) GetName() string
- func (s *Define) GetTypes() TypeComposite
- func (s *Define) Resolve(ctx ResolveContext)
- func (s *Define) ResolveToHasParams(ctx ResolveContext) []HasParams
- func (s *Define) Serialise(e *storage.Encoder)
- type Document
- func (s *Document) ApplyChanges(changes []protocol.TextDocumentContentChangeEvent)
- func (s *Document) ArgumentListAndFunctionCallAt(pos protocol.Position) (*ArgumentList, HasParamsResolvable)
- func (s *Document) ClassAt(pos protocol.Position) Symbol
- func (s *Document) CloneForMutate() *Document
- func (s *Document) Close()
- func (s *Document) GetClassScopeAtSymbol(symbol Symbol) string
- func (s *Document) GetHash() []byte
- func (s *Document) GetNodeLocation(node phrase.AstNode) protocol.Location
- func (s *Document) GetNodeText(node phrase.AstNode) string
- func (s *Document) GetRootNode() *phrase.Phrase
- func (s *Document) GetText() []byte
- func (s *Document) GetURI() string
- func (s *Document) GetVariableTableAt(pos protocol.Position) *VariableTable
- func (s *Document) HasTypesAt(offset int) HasTypes
- func (s *Document) HasTypesAtPos(pos protocol.Position) HasTypes
- func (s *Document) HasTypesBeforePos(pos protocol.Position) HasTypes
- func (s *Document) ImportTableAtPos(pos protocol.Position) *ImportTable
- func (s *Document) IsOpen() bool
- func (s *Document) Load()
- func (s *Document) Lock()
- func (s *Document) MarshalJSON() ([]byte, error)
- func (s *Document) NodeRange(node phrase.AstNode) protocol.Range
- func (s *Document) NodeSpineAt(offset int) util.NodeStack
- func (s *Document) OffsetAtPosition(pos protocol.Position) int
- func (s *Document) Open()
- func (s *Document) SetText(text []byte)
- func (s *Document) Unlock()
- func (s *Document) UnusedVariables() []*Variable
- func (s *Document) WordAtPos(pos protocol.Position) string
- type Expression
- type ForeachCollection
- type Function
- func (s *Function) GetChildren() []Symbol
- func (s *Function) GetCollection() string
- func (s *Function) GetDescription() string
- func (s *Function) GetDetail() string
- func (s *Function) GetIndexCollection() string
- func (s *Function) GetIndexableName() string
- func (s *Function) GetKey() string
- func (s *Function) GetLocation() protocol.Location
- func (s *Function) GetName() TypeString
- func (s *Function) GetNameLabel() string
- func (s *Function) GetParams() []*Parameter
- func (s *Function) GetReturnTypes() TypeComposite
- func (s *Function) GetScope() string
- func (s *Function) IsScopeSymbol() bool
- func (s *Function) ReferenceFQN() string
- func (s *Function) ReferenceLocation() protocol.Location
- func (s *Function) Serialise(e *storage.Encoder)
- type FunctionCall
- type GlobalVariable
- func (s *GlobalVariable) GetCollection() string
- func (s *GlobalVariable) GetDescription() string
- func (s *GlobalVariable) GetDetail() string
- func (s *GlobalVariable) GetKey() string
- func (s *GlobalVariable) GetLocation() protocol.Location
- func (s *GlobalVariable) GetName() string
- func (s *GlobalVariable) Serialise(e *storage.Encoder)
- type HasName
- type HasParams
- type HasParamsResolvable
- type HasScope
- type HasTypes
- type HasTypesHasScope
- type ImportTable
- func (i ImportTable) FunctionPossibleFQNs(name TypeString) []string
- func (i ImportTable) GetClassReferenceFQN(name TypeString) string
- func (i ImportTable) GetConstReferenceFQN(q *Query, name TypeString) string
- func (i ImportTable) GetFunctionReferenceFQN(q *Query, name TypeString) string
- func (i ImportTable) GetNamespace() string
- func (i ImportTable) ResolveScopeNamespace(word string) string
- func (i ImportTable) ResolveToQualified(document *Document, symbol Symbol, name TypeString, word string) (string, *protocol.TextEdit)
- type InheritedClassConst
- type InheritedMethods
- func (m InheritedMethods) Len() int
- func (m *InheritedMethods) Merge(other InheritedMethods)
- func (m InheritedMethods) ReduceAccess(currentClass string, access MemberAccess) []MethodWithScope
- func (m InheritedMethods) ReduceFirst() MethodWithScope
- func (m InheritedMethods) ReduceStatic(currentClass string, access MemberAccess) []MethodWithScope
- type InheritedProps
- type InsertUseContext
- type Interface
- func (s *Interface) GetChildren() []Symbol
- func (s *Interface) GetCollection() string
- func (s *Interface) GetDescription() string
- func (s *Interface) GetIndexCollection() string
- func (s *Interface) GetIndexableName() string
- func (s *Interface) GetKey() string
- func (s *Interface) GetLocation() protocol.Location
- func (s *Interface) GetScope() string
- func (s *Interface) IsScopeSymbol() bool
- func (s *Interface) ReferenceFQN() string
- func (s *Interface) ReferenceLocation() protocol.Location
- func (s *Interface) Serialise(e *storage.Encoder)
- type InterfaceAccess
- type MemberAccess
- type MemberAccessExpression
- type MemberSymbol
- type Method
- func (s *Method) GetChildren() []Symbol
- func (s *Method) GetCollection() string
- func (s Method) GetDescription() string
- func (s *Method) GetIndexCollection() string
- func (s *Method) GetIndexableName() string
- func (s *Method) GetKey() string
- func (s Method) GetLocation() protocol.Location
- func (s Method) GetName() string
- func (s *Method) GetNameLabel() string
- func (s *Method) GetParams() []*Parameter
- func (s Method) GetReturnTypes() TypeComposite
- func (s *Method) GetScope() string
- func (s *Method) IsScopeSymbol() bool
- func (s *Method) IsStatic() bool
- func (s *Method) ReferenceFQN() string
- func (s *Method) ReferenceLocation() protocol.Location
- func (s *Method) ScopeTypeString() TypeString
- func (s *Method) Serialise(e *storage.Encoder)
- func (s *Method) Visibility() VisibilityModifierValue
- type MethodAccess
- func (s *MethodAccess) GetLocation() protocol.Location
- func (s *MethodAccess) GetScopeTypes() TypeComposite
- func (s *MethodAccess) GetTypes() TypeComposite
- func (s *MethodAccess) MemberName() string
- func (s *MethodAccess) Resolve(ctx ResolveContext)
- func (s *MethodAccess) ResolveToHasParams(ctx ResolveContext) []HasParams
- type MethodWithScope
- type NameIndexable
- type Namespace
- type Parameter
- type PropWithScope
- type Property
- func (s *Property) GetCollection() string
- func (s *Property) GetDescription() string
- func (s *Property) GetIndexCollection() string
- func (s *Property) GetIndexableName() string
- func (s *Property) GetKey() string
- func (s *Property) GetLocation() protocol.Location
- func (s *Property) GetName() string
- func (s *Property) GetScope() string
- func (s *Property) IsScopeSymbol() bool
- func (s *Property) IsStatic() bool
- func (s *Property) ReferenceFQN() string
- func (s *Property) ReferenceLocation() protocol.Location
- func (s *Property) ScopeTypeString() TypeString
- func (s *Property) Serialise(e *storage.Encoder)
- func (s *Property) Visibility() VisibilityModifierValue
- type PropertyAccess
- type Query
- func (q *Query) GetClassClassConsts(class *Class, name string, searchedFQNs map[string]struct{}) InheritedClassConst
- func (q *Query) GetClassConstructor(class *Class) MethodWithScope
- func (q *Query) GetClassConsts(scope string, name string) []*ClassConst
- func (q *Query) GetClassMethods(class *Class, name string, searchedFQNs map[string]struct{}) InheritedMethods
- func (q *Query) GetClassProps(class *Class, name string, searchedFQNs map[string]struct{}) InheritedProps
- func (q *Query) GetClasses(name string) []*Class
- func (q *Query) GetConsts(name string) []*Const
- func (q *Query) GetDefines(name string) []*Define
- func (q *Query) GetFunctions(name string) []*Function
- func (q *Query) GetGlobalVariables(name string) []*GlobalVariable
- func (q *Query) GetInterfaceClassConsts(intf *Interface, name string, searchedFQNs map[string]struct{}) InheritedClassConst
- func (q *Query) GetInterfaceMethods(intf *Interface, name string, searchedFQNs map[string]struct{}) InheritedMethods
- func (q *Query) GetInterfaceProps(intf *Interface, name string, searchedFQNs map[string]struct{}) InheritedProps
- func (q *Query) GetInterfaces(name string) []*Interface
- func (q *Query) GetMethods(scope string, name string) []*Method
- func (q *Query) GetProps(scope, name string) []*Property
- func (q *Query) GetTraitMethods(trait *Trait, name string) InheritedMethods
- func (q *Query) GetTraits(name string) []*Trait
- func (q *Query) SearchClassClassConsts(class *Class, keyword string, searchedFQNs map[string]struct{}) InheritedClassConst
- func (q *Query) SearchClassMethods(class *Class, keyword string, searchedFQNs map[string]struct{}) InheritedMethods
- func (q *Query) SearchClassProps(class *Class, keyword string, searchedFQNs map[string]struct{}) InheritedProps
- func (q *Query) SearchInterfaceClassConsts(intf *Interface, keyword string, searchedFQNs map[string]struct{}) InheritedClassConst
- func (q *Query) SearchInterfaceMethods(intf *Interface, keyword string, searchedFQNs map[string]struct{}) InheritedMethods
- func (q *Query) SearchInterfaceProps(intf *Interface, keyword string, searchedFQNs map[string]struct{}) InheritedProps
- func (q Query) Store() *Store
- type RelationMap
- type Relations
- type RelativeScope
- type ResolveContext
- type ScopedConstantAccess
- type ScopedMethodAccess
- func (s *ScopedMethodAccess) GetLocation() protocol.Location
- func (s *ScopedMethodAccess) GetScopeTypes() TypeComposite
- func (s *ScopedMethodAccess) GetTypes() TypeComposite
- func (s *ScopedMethodAccess) MemberName() string
- func (s *ScopedMethodAccess) Resolve(ctx ResolveContext)
- func (s *ScopedMethodAccess) ResolveToHasParams(ctx ResolveContext) []HasParams
- type ScopedPropertyAccess
- type SearchOptions
- type SearchResult
- type Store
- func (s *Store) Clear()
- func (s *Store) Close()
- func (s *Store) CloseDocument(ctx context.Context, uri protocol.DocumentURI)
- func (s *Store) CompareAndIndexDocument(ctx context.Context, uri string) *Document
- func (s *Store) DeleteDocument(uri protocol.DocumentURI)
- func (s *Store) DeleteFolder(uri protocol.DocumentURI)
- func (s *Store) FinishIndexing()
- func (s *Store) GetAllClassConsts(scope string) []*ClassConst
- func (s *Store) GetAllMethods(scope string) []*Method
- func (s *Store) GetAllProperties(scope string) []*Property
- func (s *Store) GetClassConsts(scope string, name string) []*ClassConst
- func (s *Store) GetClasses(name string) []*Class
- func (s *Store) GetConsts(name string) []*Const
- func (s *Store) GetDefines(name string) []*Define
- func (s *Store) GetFunctions(name string) []*Function
- func (s *Store) GetGlobalVariables(name string) []*GlobalVariable
- func (s *Store) GetInterfaces(name string) []*Interface
- func (s *Store) GetMethods(scope string, name string) []*Method
- func (s *Store) GetOrCreateDocument(ctx context.Context, uri protocol.DocumentURI) *Document
- func (s *Store) GetProperties(scope string, name string) []*Property
- func (s *Store) GetReferences(ref string) []protocol.Location
- func (s *Store) GetStoreVersion() string
- func (s *Store) GetTraits(name string) []*Trait
- func (s *Store) GetURI() protocol.DocumentURI
- func (s *Store) LoadStubs()
- func (s *Store) Migrate(newVersion string)
- func (s *Store) OpenDocument(ctx context.Context, uri protocol.DocumentURI) *Document
- func (s *Store) PrepareForIndexing()
- func (s *Store) PutVersion(version string)
- func (s *Store) SaveDocOnStore(document *Document)
- func (s *Store) SearchClassConsts(scope string, keyword string, options SearchOptions) ([]*ClassConst, SearchResult)
- func (s *Store) SearchClasses(keyword string, options SearchOptions) ([]*Class, SearchResult)
- func (s *Store) SearchConsts(keyword string, options SearchOptions) ([]*Const, SearchResult)
- func (s *Store) SearchDefines(keyword string, options SearchOptions) ([]*Define, SearchResult)
- func (s *Store) SearchFunctions(keyword string, options SearchOptions) ([]*Function, SearchResult)
- func (s *Store) SearchInterfaces(keyword string, options SearchOptions) ([]*Interface, SearchResult)
- func (s *Store) SearchMethods(scope string, keyword string, options SearchOptions) ([]*Method, SearchResult)
- func (s *Store) SearchNamespaces(keyword string, options SearchOptions) ([]string, SearchResult)
- func (s *Store) SearchProperties(scope string, keyword string, options SearchOptions) ([]*Property, SearchResult)
- func (s *Store) SearchTraits(keyword string, options SearchOptions) ([]*Trait, SearchResult)
- func (s *Store) SyncDocument(document *Document)
- type Symbol
- type SymbolReference
- type Trait
- func (s *Trait) GetChildren() []Symbol
- func (s *Trait) GetCollection() string
- func (s *Trait) GetDescription() string
- func (s *Trait) GetIndexCollection() string
- func (s *Trait) GetIndexableName() string
- func (s *Trait) GetKey() string
- func (s *Trait) GetLocation() protocol.Location
- func (s *Trait) GetName() string
- func (s *Trait) Serialise(e *storage.Encoder)
- type TraitAccess
- type TypeComposite
- type TypeDeclaration
- type TypeString
- func (t TypeString) Dearray() (TypeString, bool)
- func (t TypeString) FirstPart() string
- func (t TypeString) GetFQN() string
- func (t TypeString) GetFirstAndRestParts() (string, []string)
- func (t TypeString) GetNamespace() string
- func (t TypeString) GetOriginal() string
- func (t TypeString) GetParts() []string
- func (t TypeString) IsEmpty() bool
- func (t *TypeString) MarshalJSON() ([]byte, error)
- func (t *TypeString) SetFQN(fqn string)
- func (t *TypeString) SetNamespace(namespace string)
- func (t TypeString) ToString() string
- func (t TypeString) Write(e *storage.Encoder)
- type UseType
- type Variable
- type VariableTable
- type VisibilityModifierValue
Constants ¶
const ( // Public indicates public visibility Public VisibilityModifierValue = iota // Protected indicates protected visibility Protected = iota // Private indicates private visibility Private = iota )
const ( // NoClassModifier indicates there is no class modifier NoClassModifier ClassModifierValue = iota // Abstract indicates there is an abstract keyword Abstract = iota // Final indicates there is a final keyword Final = iota )
const ( UseClass UseType = iota UseFunction = iota UseConst = iota )
const KeySep string = "\x00"
KeySep is the separator when constructing key
Variables ¶
var Aliases = map[string]string{
"boolean": "bool",
"integer": "int",
}
Aliases is a constant to look up aliases (e.g. boolean is bool)
var IgnoreTokenSet mapset.Set[lexer.TokenType]
var Natives = map[string]bool{ "mixed": true, "null": true, "bool": true, "true": true, "false": true, "int": true, "float": true, "real": true, "double": true, "string": true, "binary": true, "array": true, "object": true, "callable": true, "void": true, "static": true, "$this": true, "__DIR__": true, "__FILE__": true, }
Natives is a constant to look up native types
Functions ¶
func DeprecatedDiagnostics ¶
func DeprecatedDiagnostics(ctx ResolveContext) []protocol.Diagnostic
DeprecatedDiagnostics returns the diagnostics for deprecated references
func GetClassFQNLowerCase ¶
GetClassFQNLowerCase gets the lower case version of FQN which is lower case name and the rest is left as is
func GetParserDiagnostics ¶
func GetParserDiagnostics(document *Document) []protocol.Diagnostic
GetParserDiagnostics returns the diagnostics for the syntax error
func IsInherited ¶
func IsInherited(currentClass string, access MemberAccess, relationMap RelationMap, member MemberSymbol) bool
IsInherited checks whether the given conditions can inherit the symbol with non-static rules
func IsInheritedStatic ¶
func IsInheritedStatic(currentClass string, access MemberAccess, relationMap RelationMap, member MemberSymbol) bool
IsInheritedStatic checks the given conditions if it can be inherited
func IsNameParent ¶
func IsNameRelative ¶
func TraverseDocument ¶
func TraverseSymbol ¶
func UnusedDiagnostics ¶
func UnusedDiagnostics(document *Document) []protocol.Diagnostic
UnusedDiagnostics returns the diagnostics for unused variables or imports TODO: provide unused imports
Types ¶
type AnonymousFunction ¶
type AnonymousFunction struct { Params []*Parameter // contains filtered or unexported fields }
func (*AnonymousFunction) GetChildren ¶
func (s *AnonymousFunction) GetChildren() []Symbol
func (*AnonymousFunction) GetLocation ¶
func (s *AnonymousFunction) GetLocation() protocol.Location
type ArgumentList ¶
type ArgumentList struct {
// contains filtered or unexported fields
}
ArgumentList contains information of arguments in function-like call
func (*ArgumentList) GetArgumentRanges ¶
func (s *ArgumentList) GetArgumentRanges() []protocol.Range
GetArgumentRanges returns the ranges of the arguments while this is not useful for providing signature help because the ranges ignore whitespaces, but this is useful for align signature annotations
func (*ArgumentList) GetArguments ¶
func (s *ArgumentList) GetArguments() []phrase.AstNode
GetArguments returns the arguments
func (*ArgumentList) GetChildren ¶
func (s *ArgumentList) GetChildren() []Symbol
func (*ArgumentList) GetLocation ¶
func (s *ArgumentList) GetLocation() protocol.Location
func (*ArgumentList) GetRanges ¶
func (s *ArgumentList) GetRanges() []protocol.Range
type BlockSymbol ¶
type Class ¶
type Class struct { Location protocol.Location Modifier ClassModifierValue Name TypeString Extends TypeString Interfaces []TypeString Use []TypeString // contains filtered or unexported fields }
Class contains information of classes
func (*Class) AddUse ¶
func (s *Class) AddUse(name TypeString)
func (*Class) GetChildren ¶
func (*Class) GetCollection ¶
func (*Class) GetDescription ¶
func (*Class) GetIndexCollection ¶
func (*Class) GetIndexableName ¶
func (*Class) GetLocation ¶
func (*Class) IsScopeSymbol ¶
func (*Class) ReferenceFQN ¶
ReferenceFQN returns the FQN of the class' name
func (*Class) ReferenceLocation ¶
ReferenceLocation returns the location of the class' name
type ClassAccess ¶
type ClassAccess struct { Expression // contains filtered or unexported fields }
ClassAccess represents a reference to the part before ::
func (*ClassAccess) GetLocation ¶
func (s *ClassAccess) GetLocation() protocol.Location
func (*ClassAccess) GetName ¶
func (s *ClassAccess) GetName() string
func (*ClassAccess) GetTypes ¶
func (s *ClassAccess) GetTypes() TypeComposite
func (*ClassAccess) Resolve ¶
func (s *ClassAccess) Resolve(ctx ResolveContext)
type ClassConst ¶
type ClassConst struct { Name string Value string Scope TypeString VisibilityModifier VisibilityModifierValue // contains filtered or unexported fields }
ClassConst contains information of class constants
func ReadClassConst ¶
func ReadClassConst(d *storage.Decoder) *ClassConst
func (*ClassConst) GetCollection ¶
func (s *ClassConst) GetCollection() string
func (*ClassConst) GetDescription ¶
func (s *ClassConst) GetDescription() string
func (*ClassConst) GetIndexCollection ¶
func (s *ClassConst) GetIndexCollection() string
func (*ClassConst) GetIndexableName ¶
func (s *ClassConst) GetIndexableName() string
func (*ClassConst) GetKey ¶
func (s *ClassConst) GetKey() string
func (*ClassConst) GetLocation ¶
func (s *ClassConst) GetLocation() protocol.Location
func (*ClassConst) GetName ¶
func (s *ClassConst) GetName() string
func (*ClassConst) GetScope ¶
func (s *ClassConst) GetScope() string
func (*ClassConst) IsScopeSymbol ¶
func (s *ClassConst) IsScopeSymbol() bool
func (*ClassConst) IsStatic ¶
func (s *ClassConst) IsStatic() bool
IsStatic is always static for class const
func (*ClassConst) ReferenceFQN ¶
func (s *ClassConst) ReferenceFQN() string
func (*ClassConst) ReferenceLocation ¶
func (s *ClassConst) ReferenceLocation() protocol.Location
func (*ClassConst) ScopeTypeString ¶
func (s *ClassConst) ScopeTypeString() TypeString
ScopeTypeString returns the class const's class name
func (*ClassConst) Serialise ¶
func (s *ClassConst) Serialise(e *storage.Encoder)
func (*ClassConst) Visibility ¶
func (s *ClassConst) Visibility() VisibilityModifierValue
Visibility returns the visibility modifier of the class const
type ClassConstWithScope ¶
type ClassConstWithScope struct { Const *ClassConst Scope Symbol Score int }
ClassConstWithScope is the class const with its scope
func MergeClassConstWithScope ¶
func MergeClassConstWithScope(items ...[]ClassConstWithScope) []ClassConstWithScope
MergeClassConstWithScope merges the items and remove duplicates
type ClassModifierValue ¶
type ClassModifierValue int
ClassModifierValue is a value of class modifier (abstract, final)
type ClassTypeDesignator ¶
type ClassTypeDesignator struct { Expression // contains filtered or unexported fields }
ClassTypeDesignator represents a reference to object creation (e.g. new TestClass())
func (*ClassTypeDesignator) GetChildren ¶
func (s *ClassTypeDesignator) GetChildren() []Symbol
func (*ClassTypeDesignator) GetLocation ¶
func (s *ClassTypeDesignator) GetLocation() protocol.Location
func (*ClassTypeDesignator) GetTypes ¶
func (s *ClassTypeDesignator) GetTypes() TypeComposite
func (*ClassTypeDesignator) ResolveToHasParams ¶
func (s *ClassTypeDesignator) ResolveToHasParams(ctx ResolveContext) []HasParams
type CompletionValue ¶
type CompletionValue string
CompletionValue holds references to uri and name
func (CompletionValue) Serialise ¶
func (cv CompletionValue) Serialise(e *storage.Encoder)
Serialise writes the CompletionValue
type Const ¶
type Const struct { Name TypeString Value string // contains filtered or unexported fields }
Const contains information of constants
func (*Const) GetCollection ¶
func (*Const) GetDescription ¶
func (*Const) GetIndexCollection ¶
func (*Const) GetIndexableName ¶
func (*Const) GetLocation ¶
type ConstantAccess ¶
type ConstantAccess struct {
Expression
}
ConstantAccess represents a reference to constant access
func (*ConstantAccess) GetLocation ¶
func (s *ConstantAccess) GetLocation() protocol.Location
func (*ConstantAccess) GetTypes ¶
func (s *ConstantAccess) GetTypes() TypeComposite
type Define ¶
type Define struct { Name TypeString Value string // contains filtered or unexported fields }
Define contains information of define constants
func ReadDefine ¶
func (*Define) GetChildren ¶
func (*Define) GetCollection ¶
func (*Define) GetDescription ¶
func (*Define) GetIndexCollection ¶
func (*Define) GetIndexableName ¶
func (*Define) GetLocation ¶
func (*Define) GetTypes ¶
func (s *Define) GetTypes() TypeComposite
func (*Define) Resolve ¶
func (s *Define) Resolve(ctx ResolveContext)
func (*Define) ResolveToHasParams ¶
func (s *Define) ResolveToHasParams(ctx ResolveContext) []HasParams
type Document ¶
type Document struct { Children []Symbol `json:"children"` // contains filtered or unexported fields }
Document contains information of documents
func NewDocument ¶
func (*Document) ApplyChanges ¶
func (s *Document) ApplyChanges(changes []protocol.TextDocumentContentChangeEvent)
ApplyChanges applies the changes to line offsets and text
func (*Document) ArgumentListAndFunctionCallAt ¶
func (s *Document) ArgumentListAndFunctionCallAt(pos protocol.Position) (*ArgumentList, HasParamsResolvable)
ArgumentListAndFunctionCallAt returns an ArgumentList and FunctionCall at the position
func (*Document) CloneForMutate ¶
CloneForMutate returns a new document with resetted state
func (*Document) GetClassScopeAtSymbol ¶
GetClassScopeAtSymbol returns the class scope at the symbol
func (*Document) GetNodeLocation ¶
GetNodeLocation retrieves the location of a phrase node
func (*Document) GetRootNode ¶
GetRootNode returns the root node of the AST tree
func (*Document) GetVariableTableAt ¶
func (s *Document) GetVariableTableAt(pos protocol.Position) *VariableTable
GetVariableTableAt returns the closest variable table which is in range
func (*Document) HasTypesAt ¶
HasTypesAt is an interface to SymbolAtPos but with offset
func (*Document) HasTypesAtPos ¶
HasTypesAtPos returns a HasTypes symbol at the position
func (*Document) HasTypesBeforePos ¶
HasTypesBeforePos returns a HasTypes before the position
func (*Document) ImportTableAtPos ¶
func (s *Document) ImportTableAtPos(pos protocol.Position) *ImportTable
ImportTableAtPos finds the importTable at the position
func (*Document) MarshalJSON ¶
MarshalJSON is used for json.Marshal
func (*Document) UnusedVariables ¶
UnusedVariables return unused declared variables in the doc
type Expression ¶
type Expression struct { Type TypeComposite Scope HasTypes Location protocol.Location Name string }
Expression represents a reference
func (*Expression) Resolve ¶
func (e *Expression) Resolve(ctx ResolveContext)
func (*Expression) ResolveAndGetScope ¶
func (e *Expression) ResolveAndGetScope(ctx ResolveContext) TypeComposite
type ForeachCollection ¶
type ForeachCollection struct {
// contains filtered or unexported fields
}
func (ForeachCollection) GetLocation ¶
func (s ForeachCollection) GetLocation() protocol.Location
func (ForeachCollection) GetTypes ¶
func (s ForeachCollection) GetTypes() TypeComposite
func (ForeachCollection) Resolve ¶
func (s ForeachCollection) Resolve(ctx ResolveContext)
type Function ¶
type Function struct { Name TypeString `json:"Name"` Params []*Parameter // contains filtered or unexported fields }
Function contains information of functions
func ReadFunction ¶
func (*Function) GetChildren ¶
func (*Function) GetCollection ¶
func (*Function) GetDescription ¶
func (*Function) GetIndexCollection ¶
func (*Function) GetIndexableName ¶
func (*Function) GetLocation ¶
func (*Function) GetName ¶
func (s *Function) GetName() TypeString
func (*Function) GetNameLabel ¶
func (*Function) GetReturnTypes ¶
func (s *Function) GetReturnTypes() TypeComposite
func (*Function) IsScopeSymbol ¶
func (*Function) ReferenceFQN ¶
ReferenceFQN returns the FQN to function's name for the reference index
func (*Function) ReferenceLocation ¶
ReferenceLocation returns the location of the function's name for reference index
type FunctionCall ¶
type FunctionCall struct { Expression // contains filtered or unexported fields }
FunctionCall represents a reference to function call
func (*FunctionCall) GetLocation ¶
func (s *FunctionCall) GetLocation() protocol.Location
func (*FunctionCall) GetTypes ¶
func (s *FunctionCall) GetTypes() TypeComposite
func (*FunctionCall) Resolve ¶
func (s *FunctionCall) Resolve(ctx ResolveContext)
func (*FunctionCall) ResolveToHasParams ¶
func (s *FunctionCall) ResolveToHasParams(ctx ResolveContext) []HasParams
type GlobalVariable ¶
type GlobalVariable struct { Name string // contains filtered or unexported fields }
func ReadGlobalVariable ¶
func ReadGlobalVariable(d *storage.Decoder) *GlobalVariable
func (*GlobalVariable) GetCollection ¶
func (s *GlobalVariable) GetCollection() string
func (*GlobalVariable) GetDescription ¶
func (s *GlobalVariable) GetDescription() string
func (*GlobalVariable) GetDetail ¶
func (s *GlobalVariable) GetDetail() string
func (*GlobalVariable) GetKey ¶
func (s *GlobalVariable) GetKey() string
func (*GlobalVariable) GetLocation ¶
func (s *GlobalVariable) GetLocation() protocol.Location
func (*GlobalVariable) GetName ¶
func (s *GlobalVariable) GetName() string
func (*GlobalVariable) Serialise ¶
func (s *GlobalVariable) Serialise(e *storage.Encoder)
type HasParamsResolvable ¶
type HasParamsResolvable interface {
ResolveToHasParams(ctx ResolveContext) []HasParams
}
type HasTypes ¶
type HasTypes interface { Symbol GetTypes() TypeComposite Resolve(ctx ResolveContext) }
type HasTypesHasScope ¶
type HasTypesHasScope interface { HasTypes MemberName() string GetScopeTypes() TypeComposite }
type ImportTable ¶
type ImportTable struct {
// contains filtered or unexported fields
}
func (ImportTable) FunctionPossibleFQNs ¶
func (i ImportTable) FunctionPossibleFQNs(name TypeString) []string
func (ImportTable) GetClassReferenceFQN ¶
func (i ImportTable) GetClassReferenceFQN(name TypeString) string
func (ImportTable) GetConstReferenceFQN ¶
func (i ImportTable) GetConstReferenceFQN(q *Query, name TypeString) string
func (ImportTable) GetFunctionReferenceFQN ¶
func (i ImportTable) GetFunctionReferenceFQN(q *Query, name TypeString) string
func (ImportTable) GetNamespace ¶
func (i ImportTable) GetNamespace() string
func (ImportTable) ResolveScopeNamespace ¶
func (i ImportTable) ResolveScopeNamespace(word string) string
func (ImportTable) ResolveToQualified ¶
func (i ImportTable) ResolveToQualified(document *Document, symbol Symbol, name TypeString, word string) (string, *protocol.TextEdit)
type InheritedClassConst ¶
type InheritedClassConst struct { Consts []ClassConstWithScope RelationMap RelationMap SearchedFQNs map[string]struct{} }
InheritedClassConst contains class consts including inherited ones
func EmptyInheritedClassConst ¶
func EmptyInheritedClassConst() InheritedClassConst
EmptyInheritedClassConst creates an empty inherited class const
func NewInheritedClassConst ¶
func NewInheritedClassConst(consts []ClassConstWithScope, searchedFQNs map[string]struct{}) InheritedClassConst
NewInheritedClassConst creates inherited
func (*InheritedClassConst) Merge ¶
func (c *InheritedClassConst) Merge(other InheritedClassConst)
Merge merges current inherited class consts with others
func (InheritedClassConst) ReduceStatic ¶
func (c InheritedClassConst) ReduceStatic(currentClass string, access MemberAccess) []ClassConstWithScope
ReduceStatic reduces the inherited props using the static rules
type InheritedMethods ¶
type InheritedMethods struct { Methods []MethodWithScope RelationMap RelationMap SearchedFQNs map[string]struct{} }
InheritedMethods contains the methods and the searched scope names
func EmptyInheritedMethods ¶
func EmptyInheritedMethods() InheritedMethods
EmptyInheritedMethods returns an empty inherited methods
func NewInheritedMethods ¶
func NewInheritedMethods(methods []MethodWithScope, searchedFQNs map[string]struct{}) InheritedMethods
NewInheritedMethods returns InheritedMethods struct
func (*InheritedMethods) Merge ¶
func (m *InheritedMethods) Merge(other InheritedMethods)
Merge merges current inherited methods with others, this merges the underlying methods and searched FQNs
func (InheritedMethods) ReduceAccess ¶
func (m InheritedMethods) ReduceAccess(currentClass string, access MemberAccess) []MethodWithScope
ReduceAccess filters the methods by the access rules Rules:
- If the `name` is $this includes the scope is the current class or not private methods
- If the type of `scope` is the same as the current class, private methods can be accessed
- Else, only public methods can be accessed
func (InheritedMethods) ReduceFirst ¶
func (m InheritedMethods) ReduceFirst() MethodWithScope
ReduceFirst ignores static or non-static rules and returns the first public encountered method, this is useful in case of constructors which only public methods are accessible
func (InheritedMethods) ReduceStatic ¶
func (m InheritedMethods) ReduceStatic(currentClass string, access MemberAccess) []MethodWithScope
ReduceStatic filters the methods by the static rules, even though the methods are not necessarily static, e.g. self::NonStaticMethod(). Rules:
- If the `name` is parent, includes methods not from current class and not private
- If the `name` is relative (static, self), includes methods from same class or not private methods
- Otherwise, includes methods that are static and public
type InheritedProps ¶
type InheritedProps struct { Props []PropWithScope RelationMap RelationMap SearchedFQNs map[string]struct{} }
InheritedProps contains information for props include inheried ones
func EmptyInheritedProps ¶
func EmptyInheritedProps() InheritedProps
EmptyInheritedProps creates an empty InheritedProps
func NewInheritedProps ¶
func NewInheritedProps(props []PropWithScope, searchedFQNs map[string]struct{}) InheritedProps
NewInheritedProps creates InheritedProps
func (*InheritedProps) Merge ¶
func (p *InheritedProps) Merge(other InheritedProps)
Merge merges the current inherited props with others
func (InheritedProps) ReduceAccess ¶
func (p InheritedProps) ReduceAccess(currentClass string, access MemberAccess) []PropWithScope
ReduceAccess reduces propties using the access rules
func (InheritedProps) ReduceStatic ¶
func (p InheritedProps) ReduceStatic(currentClass string, access MemberAccess) []PropWithScope
ReduceStatic reduces properties using the static rules
type InsertUseContext ¶
type InsertUseContext struct {
// contains filtered or unexported fields
}
func GetInsertUseContext ¶
func GetInsertUseContext(document *Document) InsertUseContext
func (InsertUseContext) GetInsertAfterNode ¶
func (i InsertUseContext) GetInsertAfterNode() *phrase.Phrase
func (InsertUseContext) GetInsertPosition ¶
func (i InsertUseContext) GetInsertPosition() (protocol.Position, bool)
func (InsertUseContext) GetUseEdit ¶
func (i InsertUseContext) GetUseEdit(typeString TypeString, symbol Symbol, alias string) *protocol.TextEdit
type Interface ¶
type Interface struct { Name TypeString Extends []TypeString // contains filtered or unexported fields }
Interface contains information of interfaces
func ReadInterface ¶
func (*Interface) GetChildren ¶
func (*Interface) GetCollection ¶
func (*Interface) GetDescription ¶
func (*Interface) GetIndexCollection ¶
func (*Interface) GetIndexableName ¶
func (*Interface) GetLocation ¶
func (*Interface) IsScopeSymbol ¶
func (*Interface) ReferenceFQN ¶
ReferenceFQN returns the interface's FQN for reference index
func (*Interface) ReferenceLocation ¶
ReferenceLocation returns the location of the interface's name
type InterfaceAccess ¶
type InterfaceAccess struct {
Expression
}
InterfaceAccess represents a reference to the part before ::
func (*InterfaceAccess) GetLocation ¶
func (s *InterfaceAccess) GetLocation() protocol.Location
func (*InterfaceAccess) GetTypes ¶
func (s *InterfaceAccess) GetTypes() TypeComposite
type MemberAccess ¶
type MemberAccess interface { HasTypes ScopeName() string ScopeTypes() TypeComposite }
MemberAccess is a has types that accesses via a scope name and types
type MemberAccessExpression ¶
type MemberAccessExpression struct {
Expression
}
MemberAccessExpression is the base struct for non-static member access
func (*MemberAccessExpression) ScopeName ¶
func (m *MemberAccessExpression) ScopeName() string
ScopeName returns the name of the accessed scope
func (*MemberAccessExpression) ScopeTypes ¶
func (m *MemberAccessExpression) ScopeTypes() TypeComposite
ScopeTypes returns the types of the scope, this should be resolved before calling this
type MemberSymbol ¶
type MemberSymbol interface { ScopeTypeString() TypeString IsStatic() bool Visibility() VisibilityModifierValue }
MemberSymbol is a symbol that is a member of another symbol (class consts, methods and props)
type Method ¶
type Method struct { Name string Params []*Parameter Scope TypeString VisibilityModifier VisibilityModifierValue ClassModifier ClassModifierValue // contains filtered or unexported fields }
Method contains information of methods
func ReadMethod ¶
func (*Method) GetChildren ¶
func (*Method) GetCollection ¶
func (Method) GetDescription ¶
func (*Method) GetIndexCollection ¶
func (*Method) GetIndexableName ¶
func (Method) GetLocation ¶
func (*Method) GetNameLabel ¶
func (Method) GetReturnTypes ¶
func (s Method) GetReturnTypes() TypeComposite
func (*Method) IsScopeSymbol ¶
func (*Method) ReferenceFQN ¶
ReferenceFQN returns the FQN for the method
func (*Method) ReferenceLocation ¶
ReferenceLocation returns the location for the method's name
func (*Method) ScopeTypeString ¶
func (s *Method) ScopeTypeString() TypeString
ScopeTypeString returns the class scope
func (*Method) Visibility ¶
func (s *Method) Visibility() VisibilityModifierValue
Visibility returns the visibility modifier of the method
type MethodAccess ¶
type MethodAccess struct { MemberAccessExpression // contains filtered or unexported fields }
func (*MethodAccess) GetLocation ¶
func (s *MethodAccess) GetLocation() protocol.Location
func (*MethodAccess) GetScopeTypes ¶
func (s *MethodAccess) GetScopeTypes() TypeComposite
func (*MethodAccess) GetTypes ¶
func (s *MethodAccess) GetTypes() TypeComposite
func (*MethodAccess) MemberName ¶
func (s *MethodAccess) MemberName() string
func (*MethodAccess) Resolve ¶
func (s *MethodAccess) Resolve(ctx ResolveContext)
func (*MethodAccess) ResolveToHasParams ¶
func (s *MethodAccess) ResolveToHasParams(ctx ResolveContext) []HasParams
type MethodWithScope ¶
MethodWithScope represents a method with its scope
func MergeMethodWithScope ¶
func MergeMethodWithScope(items ...[]MethodWithScope) []MethodWithScope
MergeMethodWithScope returns a merged methods with scope
type NameIndexable ¶
NameIndexable indicates a symbol is name indexable, i.e. have completion
type Parameter ¶
type Parameter struct { Name string `json:"Name"` Type TypeComposite `json:"Type"` Value string `json:"Value"` // contains filtered or unexported fields }
Parameter contains information of a function parameter
func ReadParameter ¶
func (*Parameter) GetDescription ¶
func (*Parameter) GetLocation ¶
func (Parameter) ToVariable ¶
type PropWithScope ¶
PropWithScope represents a property with a scope
func MergePropWithScope ¶
func MergePropWithScope(items ...[]PropWithScope) []PropWithScope
MergePropWithScope returns a merged props with scope
type Property ¶
type Property struct { Name string Scope TypeString VisibilityModifier VisibilityModifierValue Types TypeComposite // contains filtered or unexported fields }
Property contains information for properties
func ReadProperty ¶
func (*Property) GetCollection ¶
func (*Property) GetDescription ¶
func (*Property) GetIndexCollection ¶
func (*Property) GetIndexableName ¶
func (*Property) GetLocation ¶
func (*Property) IsScopeSymbol ¶
func (*Property) ReferenceFQN ¶
ReferenceFQN returns the FQN of the property
func (*Property) ReferenceLocation ¶
ReferenceLocation returns the location of the property's name
func (*Property) ScopeTypeString ¶
func (s *Property) ScopeTypeString() TypeString
ScopeTypeString returns the class scope of the property
func (*Property) Visibility ¶
func (s *Property) Visibility() VisibilityModifierValue
Visibility returns the visibility modifier value for the property
type PropertyAccess ¶
type PropertyAccess struct { MemberAccessExpression // contains filtered or unexported fields }
func (*PropertyAccess) GetLocation ¶
func (s *PropertyAccess) GetLocation() protocol.Location
func (*PropertyAccess) GetScopeTypes ¶
func (s *PropertyAccess) GetScopeTypes() TypeComposite
func (*PropertyAccess) GetTypes ¶
func (s *PropertyAccess) GetTypes() TypeComposite
func (*PropertyAccess) MemberName ¶
func (s *PropertyAccess) MemberName() string
func (*PropertyAccess) Resolve ¶
func (s *PropertyAccess) Resolve(ctx ResolveContext)
type Query ¶
type Query struct {
// contains filtered or unexported fields
}
Query is a wrapper around store
func (*Query) GetClassClassConsts ¶
func (q *Query) GetClassClassConsts(class *Class, name string, searchedFQNs map[string]struct{}) InheritedClassConst
GetClassClassConsts returns the inherited class const
func (*Query) GetClassConstructor ¶
func (q *Query) GetClassConstructor(class *Class) MethodWithScope
GetClassConstructor returns the constructor of the given class including the inherited constructor from parent
func (*Query) GetClassConsts ¶
func (q *Query) GetClassConsts(scope string, name string) []*ClassConst
GetClassConsts is a cached proxy to store
func (*Query) GetClassMethods ¶
func (q *Query) GetClassMethods(class *Class, name string, searchedFQNs map[string]struct{}) InheritedMethods
GetClassMethods returns all methods from the given class, its extends and implements
func (*Query) GetClassProps ¶
func (q *Query) GetClassProps(class *Class, name string, searchedFQNs map[string]struct{}) InheritedProps
GetClassProps gets all properties for a class
func (*Query) GetClasses ¶
GetClasses is a cached proxy behind store
func (*Query) GetDefines ¶
GetDefines is a cached proxy behind store
func (*Query) GetFunctions ¶
GetFunctions is a cached proxy behind store
func (*Query) GetGlobalVariables ¶
func (q *Query) GetGlobalVariables(name string) []*GlobalVariable
GetGlobalVariables returns global variables with the given name
func (*Query) GetInterfaceClassConsts ¶
func (q *Query) GetInterfaceClassConsts(intf *Interface, name string, searchedFQNs map[string]struct{}) InheritedClassConst
GetInterfaceClassConsts returns the class consts of the interface
func (*Query) GetInterfaceMethods ¶
func (q *Query) GetInterfaceMethods(intf *Interface, name string, searchedFQNs map[string]struct{}) InheritedMethods
GetInterfaceMethods returns all methods from the given interface and its extends
func (*Query) GetInterfaceProps ¶
func (q *Query) GetInterfaceProps(intf *Interface, name string, searchedFQNs map[string]struct{}) InheritedProps
GetInterfaceProps gets all properties for an interface
func (*Query) GetInterfaces ¶
GetInterfaces is a cached proxy behind store
func (*Query) GetMethods ¶
GetMethods searches for all methods under the given scope, this function does not consider inheritance, if name is empty this will return all methods
func (*Query) GetTraitMethods ¶
func (q *Query) GetTraitMethods(trait *Trait, name string) InheritedMethods
GetTraitMethods returns all methods from the given trait and name
func (*Query) SearchClassClassConsts ¶
func (q *Query) SearchClassClassConsts(class *Class, keyword string, searchedFQNs map[string]struct{}) InheritedClassConst
SearchClassClassConsts searches for class consts using fuzzy match
func (*Query) SearchClassMethods ¶
func (q *Query) SearchClassMethods(class *Class, keyword string, searchedFQNs map[string]struct{}) InheritedMethods
SearchClassMethods searches methods using fuzzy
func (*Query) SearchClassProps ¶
func (q *Query) SearchClassProps(class *Class, keyword string, searchedFQNs map[string]struct{}) InheritedProps
SearchClassProps searches for class props using fuzzy match
func (*Query) SearchInterfaceClassConsts ¶
func (q *Query) SearchInterfaceClassConsts(intf *Interface, keyword string, searchedFQNs map[string]struct{}) InheritedClassConst
SearchInterfaceClassConsts searches for class consts using fuzzy match
func (*Query) SearchInterfaceMethods ¶
func (q *Query) SearchInterfaceMethods(intf *Interface, keyword string, searchedFQNs map[string]struct{}) InheritedMethods
SearchInterfaceMethods searches methods using fuzzy
func (*Query) SearchInterfaceProps ¶
func (q *Query) SearchInterfaceProps(intf *Interface, keyword string, searchedFQNs map[string]struct{}) InheritedProps
SearchInterfaceProps searches for class props using fuzzy match
type RelationMap ¶
RelationMap is the map for relationships
func (RelationMap) IsRelated ¶
func (r RelationMap) IsRelated(thisFQN string, otherFQN string) bool
IsRelated checks if this FQN is related to other FQN
func (RelationMap) Merge ¶
func (r RelationMap) Merge(other RelationMap)
Merge merges other relation map to current
func (RelationMap) Relate ¶
func (r RelationMap) Relate(thisFQN string, otherFQN string)
Relate sets the related FQNs
type Relations ¶
type Relations map[string]struct{}
Relations represents the related FQNs
type RelativeScope ¶
type RelativeScope struct { Types TypeComposite // contains filtered or unexported fields }
func (*RelativeScope) GetLocation ¶
func (s *RelativeScope) GetLocation() protocol.Location
func (*RelativeScope) GetTypes ¶
func (s *RelativeScope) GetTypes() TypeComposite
func (*RelativeScope) Resolve ¶
func (s *RelativeScope) Resolve(ctx ResolveContext)
type ResolveContext ¶
type ResolveContext struct {
// contains filtered or unexported fields
}
ResolveContext contains query and document
func NewResolveContext ¶
func NewResolveContext(query *Query, document *Document) ResolveContext
NewResolveContext creates a resolve context
type ScopedConstantAccess ¶
type ScopedConstantAccess struct {
MemberAccessExpression
}
ScopedConstantAccess represents a reference to constant in class access, e.g. ::CONSTANT
func (*ScopedConstantAccess) GetLocation ¶
func (s *ScopedConstantAccess) GetLocation() protocol.Location
func (*ScopedConstantAccess) GetScopeTypes ¶
func (s *ScopedConstantAccess) GetScopeTypes() TypeComposite
GetScopeTypes returns the types of the scope
func (*ScopedConstantAccess) GetTypes ¶
func (s *ScopedConstantAccess) GetTypes() TypeComposite
func (*ScopedConstantAccess) MemberName ¶
func (s *ScopedConstantAccess) MemberName() string
MemberName returns the class constant name
type ScopedMethodAccess ¶
type ScopedMethodAccess struct { MemberAccessExpression // contains filtered or unexported fields }
ScopedMethodAccess represents a reference to method in class access, e.g. ::method()
func (*ScopedMethodAccess) GetLocation ¶
func (s *ScopedMethodAccess) GetLocation() protocol.Location
func (*ScopedMethodAccess) GetScopeTypes ¶
func (s *ScopedMethodAccess) GetScopeTypes() TypeComposite
func (*ScopedMethodAccess) GetTypes ¶
func (s *ScopedMethodAccess) GetTypes() TypeComposite
func (*ScopedMethodAccess) MemberName ¶
func (s *ScopedMethodAccess) MemberName() string
func (*ScopedMethodAccess) Resolve ¶
func (s *ScopedMethodAccess) Resolve(ctx ResolveContext)
func (*ScopedMethodAccess) ResolveToHasParams ¶
func (s *ScopedMethodAccess) ResolveToHasParams(ctx ResolveContext) []HasParams
type ScopedPropertyAccess ¶
type ScopedPropertyAccess struct { MemberAccessExpression // contains filtered or unexported fields }
ScopedPropertyAccess represents a reference to property in scoped class access, e.g. ::$property
func (*ScopedPropertyAccess) GetLocation ¶
func (s *ScopedPropertyAccess) GetLocation() protocol.Location
func (*ScopedPropertyAccess) GetScopeTypes ¶
func (s *ScopedPropertyAccess) GetScopeTypes() TypeComposite
func (*ScopedPropertyAccess) GetTypes ¶
func (s *ScopedPropertyAccess) GetTypes() TypeComposite
func (*ScopedPropertyAccess) MemberName ¶
func (s *ScopedPropertyAccess) MemberName() string
func (*ScopedPropertyAccess) Resolve ¶
func (s *ScopedPropertyAccess) Resolve(ctx ResolveContext)
type SearchOptions ¶
type SearchOptions struct {
// contains filtered or unexported fields
}
SearchOptions contains predicates and limiter if applicable for searching symbols
func NewSearchOptions ¶
func NewSearchOptions() SearchOptions
NewSearchOptions creates an empty search option
func (SearchOptions) IsLimitReached ¶
func (s SearchOptions) IsLimitReached() bool
IsLimitReached returns true if the limitter reaches the limit
func (SearchOptions) WithLimit ¶
func (s SearchOptions) WithLimit(limit int) SearchOptions
WithLimit adds a limiter into the search option
func (SearchOptions) WithPredicate ¶
func (s SearchOptions) WithPredicate(predicate func(s Symbol) bool) SearchOptions
WithPredicate adds a predicate into the search option
type SearchResult ¶
type SearchResult struct {
IsComplete bool
}
type Store ¶
type Store struct { FS protocol.FS DebouncedDeprecation func(func()) // contains filtered or unexported fields }
Store contains information about a given folder and functions for querying symbols
func NewStore ¶
NewStore creates a store with the disk storage or returns an error if the disk storage cannot be created
func (*Store) Close ¶
func (s *Store) Close()
Close triggers close on the fuzzy engine, and closes the disk storage
func (*Store) CloseDocument ¶
func (s *Store) CloseDocument(ctx context.Context, uri protocol.DocumentURI)
CloseDocument syncs the document with the given URI and marks it as close to release memory
func (*Store) CompareAndIndexDocument ¶
CompareAndIndexDocument compares the file's hash with the stored one on the disk, and if they are not matched load the document and sync. The pointer to the document is returned
func (*Store) DeleteDocument ¶
func (s *Store) DeleteDocument(uri protocol.DocumentURI)
DeleteDocument deletes all symbols and indexes relating to the URI this returns error if the disk cannot be written
func (*Store) DeleteFolder ¶
func (s *Store) DeleteFolder(uri protocol.DocumentURI)
DeleteFolder searches for documents and triggers `DeleteDocument`
func (*Store) FinishIndexing ¶
func (s *Store) FinishIndexing()
FinishIndexing checks for all URIs that are not removed from the map and delete them, because if the file exists its URI should be removed from the map
func (*Store) GetAllClassConsts ¶
func (s *Store) GetAllClassConsts(scope string) []*ClassConst
GetAllClassConsts returns all the class constants under the given scope. The word class is used loosely in here, which means it can be classes/interfaces/traits
func (*Store) GetAllMethods ¶
GetAllMethods returns all the methods with the given scope. This function can be faster than `SearchMethods` for searching only methods under given scope, because this only scans methods which have the given scope
func (*Store) GetAllProperties ¶
GetAllProperties searches all properties with the given scope from the disk storage
func (*Store) GetClassConsts ¶
func (s *Store) GetClassConsts(scope string, name string) []*ClassConst
GetClassConsts searches all class constants with the given scope and name from the disk storage. The word class is used loosely in here which means it can be interfaces/traits
func (*Store) GetClasses ¶
GetClasses searches all classes with the given name
func (*Store) GetConsts ¶
GetConsts searches all the consts with the given name from the disk storage
func (*Store) GetDefines ¶
GetDefines searches all `define()` with the given name from the disk storage
func (*Store) GetFunctions ¶
GetFunctions searches all functions with the given name from the disk storage
func (*Store) GetGlobalVariables ¶
func (s *Store) GetGlobalVariables(name string) []*GlobalVariable
GetGlobalVariables searches all global variables with the given name from the disk storage
func (*Store) GetInterfaces ¶
GetInterfaces searches all the interfaces with the given name from the disk storage
func (*Store) GetMethods ¶
GetMethods searches for all methods with the same scope and name as given
func (*Store) GetOrCreateDocument ¶
GetOrCreateDocument checks if the store contains the given URI or create a new document with the given URI
func (*Store) GetProperties ¶
GetProperties searches all properties with the given scope and name from the disk storage
func (*Store) GetReferences ¶
GetReferences returns the locations of the reference to an FQN
func (*Store) GetStoreVersion ¶
GetStoreVersion returns the version of the disk storage or v0.0.0 if the version is missing from the disk
func (*Store) GetTraits ¶
GetTraits searches for all the traits with the given name from the disk storage
func (*Store) LoadStubs ¶
func (s *Store) LoadStubs()
LoadStubs loads the defined stubs, compare their hash and index them if needed
func (*Store) OpenDocument ¶
OpenDocument loads and index the document with the given URI, at the same time marks it as open to retain it on the memory
func (*Store) PrepareForIndexing ¶
func (s *Store) PrepareForIndexing()
PrepareForIndexing loads all the synced documents from the disk storage into memory, this is to make sure that any deleted documents that are not yet synced, get deleted
func (*Store) PutVersion ¶
PutVersion stores the given version on the disk
func (*Store) SaveDocOnStore ¶
SaveDocOnStore retains the document in memory
func (*Store) SearchClassConsts ¶
func (s *Store) SearchClassConsts(scope string, keyword string, options SearchOptions) ([]*ClassConst, SearchResult)
SearchClassConsts uses completion index to search class constants matching the given scope and keyword. If the scope is empty all matched class constants are returned. The word class is used loosely in here, which means it can be classes/interfaces/traits
func (*Store) SearchClasses ¶
func (s *Store) SearchClasses(keyword string, options SearchOptions) ([]*Class, SearchResult)
SearchClasses uses the completion index to search for classes with the given keyword. `keyword` can contain scope \Namespace1\Cl
func (*Store) SearchConsts ¶
func (s *Store) SearchConsts(keyword string, options SearchOptions) ([]*Const, SearchResult)
SearchConsts uses completion index to search constants matching the given keyword
func (*Store) SearchDefines ¶
func (s *Store) SearchDefines(keyword string, options SearchOptions) ([]*Define, SearchResult)
SearchDefines uses completion index to search `define()`s matching the given keyword
func (*Store) SearchFunctions ¶
func (s *Store) SearchFunctions(keyword string, options SearchOptions) ([]*Function, SearchResult)
SearchFunctions uses the completion index to search functions matching the given keyword. `keyword` can contain scope
func (*Store) SearchInterfaces ¶
func (s *Store) SearchInterfaces(keyword string, options SearchOptions) ([]*Interface, SearchResult)
SearchInterfaces uses completion index to search for interfaces with the given keyword. `keyword` can contain scope \Namespace1\Cl
func (*Store) SearchMethods ¶
func (s *Store) SearchMethods(scope string, keyword string, options SearchOptions) ([]*Method, SearchResult)
SearchMethods uses completion index to search methods matching the given scope and keyword. This function is slow and should only be used for searching method store-wide, because the completion index will scan through all the methods in the store and compare its scope. If the scope is "" all methods matching will be returned.
func (*Store) SearchNamespaces ¶
func (s *Store) SearchNamespaces(keyword string, options SearchOptions) ([]string, SearchResult)
SearchNamespaces searches namespaces with the given keyword, and keyword can contain a namespace scope, e.g. Namespace1\NestedNams
func (*Store) SearchProperties ¶
func (s *Store) SearchProperties(scope string, keyword string, options SearchOptions) ([]*Property, SearchResult)
SearchProperties uses completion index to search properties matching the given scope and name. If the scope is "", this will forward to `GetAllProperties`, and ignore keyword
func (*Store) SearchTraits ¶
func (s *Store) SearchTraits(keyword string, options SearchOptions) ([]*Trait, SearchResult)
SearchTraits uses completion index to search traits matching the given keyword. `keyword` can contain scope
func (*Store) SyncDocument ¶
SyncDocument writes all definition symbols and indexes to the disk or the fuzzy engine
type SymbolReference ¶
type SymbolReference interface { Symbol ReferenceFQN() string ReferenceLocation() protocol.Location }
SymbolReference is a reference to the symbol itself
type Trait ¶
type Trait struct { Name TypeString // contains filtered or unexported fields }
Trait contains information of a trait
func (*Trait) GetChildren ¶
func (*Trait) GetCollection ¶
func (*Trait) GetDescription ¶
func (*Trait) GetIndexCollection ¶
func (*Trait) GetIndexableName ¶
func (*Trait) GetLocation ¶
type TraitAccess ¶
type TraitAccess struct {
Expression
}
func (*TraitAccess) GetLocation ¶
func (s *TraitAccess) GetLocation() protocol.Location
func (*TraitAccess) GetTypes ¶
func (s *TraitAccess) GetTypes() TypeComposite
type TypeComposite ¶
type TypeComposite struct {
// contains filtered or unexported fields
}
TypeComposite contains multiple type strings
func ReadTypeComposite ¶
func ReadTypeComposite(d *storage.Decoder) TypeComposite
func (TypeComposite) IsEmpty ¶
func (t TypeComposite) IsEmpty() bool
func (TypeComposite) MarshalJSON ¶
func (t TypeComposite) MarshalJSON() ([]byte, error)
MarshalJSON marshals TypeComposite to JSON
func (TypeComposite) Resolve ¶
func (t TypeComposite) Resolve() []TypeString
Resolve resolves the type to slice of TypeString
func (TypeComposite) ToString ¶
func (t TypeComposite) ToString() string
func (*TypeComposite) Write ¶
func (t *TypeComposite) Write(e *storage.Encoder)
type TypeDeclaration ¶
type TypeDeclaration struct {
Expression
}
TypeDeclaration is type declaration for a symbol
func (*TypeDeclaration) GetLocation ¶
func (s *TypeDeclaration) GetLocation() protocol.Location
func (*TypeDeclaration) GetTypes ¶
func (s *TypeDeclaration) GetTypes() TypeComposite
type TypeString ¶
type TypeString struct {
// contains filtered or unexported fields
}
TypeString contains fqn and original name of type
func NewTypeString ¶
func NewTypeString(typeString string) TypeString
func ReadTypeString ¶
func ReadTypeString(d *storage.Decoder) TypeString
func (TypeString) Dearray ¶
func (t TypeString) Dearray() (TypeString, bool)
func (TypeString) FirstPart ¶
func (t TypeString) FirstPart() string
func (TypeString) GetFirstAndRestParts ¶
func (t TypeString) GetFirstAndRestParts() (string, []string)
func (TypeString) GetNamespace ¶
func (t TypeString) GetNamespace() string
func (TypeString) GetOriginal ¶
func (t TypeString) GetOriginal() string
GetOriginal gets original name
func (TypeString) GetParts ¶
func (t TypeString) GetParts() []string
func (TypeString) IsEmpty ¶
func (t TypeString) IsEmpty() bool
IsEmpty checks whether TypeString is empty
func (*TypeString) MarshalJSON ¶
func (t *TypeString) MarshalJSON() ([]byte, error)
MarshalJSON is used for json.Marshal
func (*TypeString) SetFQN ¶
func (t *TypeString) SetFQN(fqn string)
func (*TypeString) SetNamespace ¶
func (t *TypeString) SetNamespace(namespace string)
func (TypeString) ToString ¶
func (t TypeString) ToString() string
ToString returns the string representation of the type
func (TypeString) Write ¶
func (t TypeString) Write(e *storage.Encoder)
type Variable ¶
type Variable struct { Expression // contains filtered or unexported fields }
Variable represents a reference to the variable
func (*Variable) GetDescription ¶
func (*Variable) GetLocation ¶
func (*Variable) GetTypes ¶
func (s *Variable) GetTypes() TypeComposite
func (*Variable) Resolve ¶
func (s *Variable) Resolve(ctx ResolveContext)
type VariableTable ¶
type VariableTable struct {
// contains filtered or unexported fields
}
VariableTable holds the range and the variables inside
func (*VariableTable) GetContextualVariables ¶
func (vt *VariableTable) GetContextualVariables(name string) []contextualVariable
GetContextualVariables returns the variable instances with the given name
func (*VariableTable) GetVariables ¶
func (vt *VariableTable) GetVariables(pos protocol.Position) []*Variable
GetVariables returns all the variables in the table
type VisibilityModifierValue ¶
type VisibilityModifierValue int
VisibilityModifierValue is a value of visibility modifier (public, protected, private)
func (VisibilityModifierValue) ToString ¶
func (v VisibilityModifierValue) ToString() string
Source Files ¶
- anonymousClass.go
- anonymousFunction.go
- argumentList.go
- assignment.go
- binaryExpression.go
- class.go
- classAccess.go
- classConst.go
- classTypeDesignator.go
- completionIndex.go
- const.go
- constantAccess.go
- define.go
- diagnostic.go
- document.go
- expression.go
- foreach.go
- function.go
- functionCall.go
- globalVariable.go
- importTable.go
- insertUse.go
- interface.go
- interfaceAccess.go
- memberAccess.go
- method.go
- methodAccess.go
- namespace.go
- parameter.go
- phpDocComment.go
- property.go
- propertyAccess.go
- query.go
- referenceIndex.go
- relativeScope.go
- scopedConstantAccess.go
- scopedMethodAccess.go
- scopedPropertyAccess.go
- store.go
- symbol.go
- symbolBlock.go
- symbolType.go
- trait.go
- traitAccess.go
- try.go
- typeDeclaration.go
- use.go
- variable.go