protected override VoidStruct VisitRoutineCall(BoundRoutineCall x) { if (x.PhpSyntax != null && x.PhpSyntax.Span.Contains(_position) == true) { var invocation = (IInvocationOperation)x; if (invocation.TargetMethod != null) { if (!invocation.TargetMethod.IsImplicitlyDeclared || invocation.TargetMethod is IErrorMethodSymbol) { Span span; if (x.PhpSyntax is FunctionCall) { span = ((FunctionCall)x.PhpSyntax).NameSpan; if (span.Contains(_position)) { _result = new SymbolStat(_tctx, span, x, invocation.TargetMethod); } } } } } // return(base.VisitRoutineCall(x)); }
public override VoidStruct VisitPseudoConstUse(BoundPseudoConst x) { if (x.PhpSyntax?.Span.Contains(_position) == true) { _result = new SymbolStat(_tctx, x.PhpSyntax.Span, x, null); } return(base.VisitPseudoConstUse(x)); }
public override VoidStruct VisitVariableRef(BoundVariableRef x) { if (x.PhpSyntax?.Span.Contains(_position) == true) { var symbolOpt = x is ILocalReferenceOperation loc ? loc.Local : null; _result = new SymbolStat(_tctx, x.PhpSyntax.Span, x, symbolOpt); } // return(base.VisitVariableRef(x)); }
protected override VoidStruct DefaultVisitOperation(BoundOperation x) { if (x is IBoundTypeRef tref && tref.PhpSyntax != null && tref.PhpSyntax.Span.Contains(_position)) { var symbol = tref.ResolveTypeSymbol(DeclaringCompilation); if (symbol != null) { _result = new SymbolStat(_tctx, tref.PhpSyntax.Span, null, symbol); } } return(base.DefaultVisitOperation(x)); }
public override VoidStruct VisitFieldRef(BoundFieldRef x) { if (x.PhpSyntax?.Span.Contains(_position) == true) { Span span = x.PhpSyntax.Span; //if (x.PhpSyntax is StaticFieldUse) //{ // span = ((StaticFieldUse)x.PhpSyntax).NameSpan; //} //else if (x.PhpSyntax is ClassConstUse) //{ // span = ((ClassConstUse)x.PhpSyntax).NamePosition; //} if (span.IsValid) { _result = new SymbolStat(_tctx, span, x, ((IMemberReferenceOperation)x).Member); } } // return(base.VisitFieldRef(x)); }