private static IEnumerable <AnalysisValue> GetTestCaseClasses(IModuleAnalysis analysis) { return(analysis.GetAllMembers(SourceLocation.MinValue, GetMemberOptions.ExcludeBuiltins) .SelectMany(m => analysis.GetValues(m.Name, SourceLocation.MinValue)) .Where(v => v.MemberType == PythonMemberType.Class) .Where(v => v.Mro.SelectMany(v2 => v2).Any(IsTestCaseClass))); }
private static IEnumerable <IMemberResult> GetModuleVariables(ProjectEntry entry, GetMemberOptions opts, string prefix, IModuleAnalysis analysis) { var all = analysis.GetAllMembers(SourceLocation.None, opts); return(all .Where(m => { if (m.Values.Any(v => v.DeclaringModule == entry || v.Locations.Any(l => l.DocumentUri == entry.DocumentUri))) { if (string.IsNullOrEmpty(prefix) || m.Name.StartsWithOrdinal(prefix, ignoreCase: true)) { return true; } } return false; }) .Concat(GetChildScopesVariables(analysis, analysis.Scope, opts, 0))); }