internal IDictionary <string, IAnalysisSet> GetAllMembers(IMemberContainer container, IModuleContext moduleContext) { var names = container.GetMemberNames(moduleContext); var result = new Dictionary <string, IAnalysisSet>(); foreach (var name in names) { result[name] = GetAnalysisValueFromObjects(container.GetMember(moduleContext, name)); } var children = (container as IModule)?.GetChildrenPackages(moduleContext); if (children?.Any() ?? false) { foreach (var child in children) { IAnalysisSet existing; if (result.TryGetValue(child.Key, out existing)) { result[child.Key] = existing.Add(child.Value); } else { result[child.Key] = child.Value; } } } return(result); }
public IEnumerable <IReferenceable> GetDefinitions(string name, IMemberContainer innerContainer, IModuleContext context) { var res = new List <IReferenceable>(); ReferenceDict references; lock (_references) { _references.TryGetValue(name, out references); } if (references != null) { lock (references) { res.AddRange(references.Values); } } var member = innerContainer.GetMember(context, name) as ILocatedMember; if (member != null) { res.AddRange(member.Locations.MaybeEnumerate().Select(loc => new DefinitionList(loc))); } return(res); }
internal IDictionary <string, ISet <Namespace> > GetAllMembers(IMemberContainer container, IModuleContext moduleContext) { var names = container.GetMemberNames(moduleContext); var result = new Dictionary <string, ISet <Namespace> >(); foreach (var name in names) { result[name] = GetNamespaceFromObjects(container.GetMember(moduleContext, name)); } return(result); }
public IEnumerable <IReferenceable> GetDefinitions(string name, IMemberContainer innerContainer, IModuleContext context) { IEnumerable <IReferenceable> refs = null; ReferenceDict references; if (_references != null && _references.TryGetValue(name, out references)) { refs = references.Values; } var member = innerContainer.GetMember(context, name); if (member != null) { List <IReferenceable> res; if (refs == null) { res = new List <IReferenceable>(); } else { res = new List <IReferenceable>(refs); } ILocatedMember locatedMember = member as ILocatedMember; if (locatedMember != null) { foreach (var location in locatedMember.Locations) { res.Add(new DefinitionList(location)); } } return(res); } return(new IReferenceable[0]); }
public static IAnalysisItemView Make(IModuleContext context, IMemberContainer members, string name) { return Make(context, name, members.GetMember(context, name)); }
public static IAnalysisItemView Make(IModuleContext context, IMemberContainer members, string name) { return(Make(context, name, members.GetMember(context, name))); }
public static T GetMember <T>(this IMemberContainer mc, string name) where T : class, IPythonType => mc.GetMember(name) as T;