Exemplo n.º 1
0
 private static IEnumerable <AnalysisValue> GetTestCaseClasses(ModuleAnalysis analysis)
 {
     return(analysis.GetAllAvailableMembers(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)));
 }
Exemplo n.º 2
0
        private static IEnumerable <MemberResult> GetModuleVariables(ProjectEntry entry, GetMemberOptions opts, string prefix, ModuleAnalysis analysis)
        {
            var all = analysis.GetAllAvailableMembers(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)));
        }