diff --git a/src/Analysis/Ast/Impl/Modules/PythonModule.cs b/src/Analysis/Ast/Impl/Modules/PythonModule.cs index ea17655fb..b5fb1fa60 100644 --- a/src/Analysis/Ast/Impl/Modules/PythonModule.cs +++ b/src/Analysis/Ast/Impl/Modules/PythonModule.cs @@ -149,20 +149,11 @@ public virtual string Documentation { #region IMemberContainer public virtual IMember GetMember(string name) => Analysis.GlobalScope.Variables[name]?.Value; public virtual IEnumerable GetMemberNames() { - // Try __all__ since it contains exported members - var all = Analysis.GlobalScope.Variables["__all__"]; - if (all?.Value is IPythonCollection collection) { - return collection.Contents - .OfType() - .Select(c => c.GetString()) - .Where(s => !string.IsNullOrEmpty(s)); - } + // TODO: Filter __all__. See: https://github.com/Microsoft/python-language-server/issues/620 - // __all__ is not declared. Try filtering by origin: - // drop imported modules and generics. + // drop imported modules and typing. return Analysis.GlobalScope.Variables - .Where(v => v.Value?.MemberType != PythonMemberType.Generic - && !(v.Value?.GetPythonType() is PythonModule) + .Where(v => !(v.Value?.GetPythonType() is PythonModule) && !(v.Value?.GetPythonType().DeclaringModule is TypingModule && !(this is TypingModule))) .Select(v => v.Name); }