コード例 #1
0
        private IEnumerable <IAnalysisItemView> CalculateChildren()
        {
            if (_module == null)
            {
                _module = _interpreter.ImportModule(Name);
            }

            if (File.Exists(_idbPath))
            {
                yield return(RawView.FromFile(_idbPath));
            }

            var cpm = _module as Interpreter.LegacyDB.CPythonModule;

            if (cpm != null)
            {
                cpm.EnsureLoaded();
            }

            if (cpm != null && cpm._hiddenMembers != null)
            {
                foreach (var keyValue in cpm._hiddenMembers)
                {
                    yield return(MemberView.Make(_context, keyValue.Key, keyValue.Value));
                }
            }

            foreach (var memberName in _module.GetMemberNames(_context))
            {
                yield return(MemberView.Make(_context, _module, memberName));
            }
        }
コード例 #2
0
 private IEnumerable <IAnalysisItemView> CalculateReturnTypes()
 {
     if (_overload.ReturnType != null)
     {
         return(_overload.ReturnType.Select(t => MemberView.Make(_context, t.Name, t)));
     }
     else
     {
         return(Enumerable.Empty <IAnalysisItemView>());
     }
 }
コード例 #3
0
        private IEnumerable <IAnalysisItemView> CalculateTypes()
        {
            if (_parameter.ParameterTypes == null || _parameter.ParameterTypes.Count == 0)
            {
                return(Enumerable.Empty <IAnalysisItemView>());
            }

            return(_parameter.ParameterTypes
                   .Select(t => MemberView.Make(_context, t.Name, t))
                   .ToArray());
        }
コード例 #4
0
ファイル: FunctionView.cs プロジェクト: zhangjinxing/PTVS
        private IEnumerable <IAnalysisItemView> CalculateReturnTypes()
        {
            var seen = new HashSet <IAnalysisItemView>();

            foreach (var overload in _function.Overloads)
            {
                if (overload.ReturnType != null)
                {
                    foreach (var type in overload.ReturnType.Select(t => MemberView.Make(_context, t.Name, t)))
                    {
                        if (seen.Add(type))
                        {
                            yield return(type);
                        }
                    }
                }
            }
        }