protected override bool AddLookupItems(CSharpCodeCompletionContext context, GroupedItemsCollector collector) { var node = context.NodeInFile; if (node.GetTokenType() == CSharpTokenType.LPARENTH && node.Parent is IInvocationExpression) { var invocationExpression = (IInvocationExpression)node.Parent; IMethod method; if (ReflectedTypeHelper.IsReflectionTypeMethod(invocationExpression, false, out method)) { MethodSpecificCompletion methodSpecificCompletion; if (IsCompletionRegisteredForMethod(method, out methodSpecificCompletion)) { var reflectedType = ReflectedTypeHelper.ResolveReflectedType(invocationExpression); if (reflectedType.ResolvedAs != ReflectedTypeResolution.NotResolved) { var symbols = reflectedType.Type.GetSymbolTable(context.PsiModule) .Filter(new ExtensionMethodsFilter(reflectedType.TypeElement)); if (reflectedType.ResolvedAs == ReflectedTypeResolution.Exact || reflectedType.ResolvedAs == ReflectedTypeResolution.ExactMakeGeneric) { //merge substituted constructors var constructorsSymbols = (ISymbolTable)Activator.CreateInstance(TypeMembersSymbolsTableType, new object[] { reflectedType.TypeElement, ((IDeclaredType)reflectedType.Type).GetSubstitution(), reflectedType.TypeElement.Constructors.Where(c => !c.IsStatic), 0, null }); symbols = symbols.Merge(constructorsSymbols); } methodSpecificCompletion.ProcessMembers(context, collector, symbols); collector.AddFilter(new ReflectionMembersPreference()); } } } } return(base.AddLookupItems(context, collector)); }
private ReflectedTypeResolveResult ResolveReflectedType(IInvocationExpression invocationExpression) { return(ReflectedTypeHelper.ResolveReflectedType(invocationExpression)); }