This repository has been archived by the owner on Apr 14, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 133
Missing numpy and tensorflow completion, members not showing up #642
Comments
This was referenced Feb 22, 2019
This is about submodules in folders you are working on |
Related: #490 from setuptools. # misses `archive*` |
So in looking at #690, I realized that I hadn't checked __all__.extend(['__version__', 'show_config'])
__all__.extend(core.__all__)
__all__.extend(_mat.__all__)
__all__.extend(lib.__all__)
__all__.extend(['linalg', 'fft', 'random', 'ctypeslib', 'ma']) Which explains why we aren't getting numpy completion anymore; we have the |
If we drop all filters then all the |
The above is just: // Try __all__ since it contains exported members
var all = Analysis.GlobalScope.Variables["__all__"];
// if (all?.Value is IPythonCollection collection) {
// return collection.Contents
// .OfType<IPythonConstant>()
// .Select(c => c.GetString())
// .Where(s => !string.IsNullOrEmpty(s));
// }
// __all__ is not declared. Try filtering by origin:
// drop imported modules and generics.
return Analysis.GlobalScope.Variables
.Where(v => !(v.Value?.GetPythonType() is PythonModule)
&& !(v.Value?.GetPythonType().DeclaringModule is TypingModule && !(this is TypingModule)))
// .Where(v => v.Value?.MemberType != PythonMemberType.Generic
// && !(v.Value?.GetPythonType() is PythonModule)
// && !(v.Value?.GetPythonType().DeclaringModule is TypingModule && !(this is TypingModule)))
.Select(v => v.Name); So theoretically I'm not leaking typing or modules out. |
OK, sure |
Merged
jakebailey
added a commit
to jakebailey/python-language-server
that referenced
this issue
Nov 1, 2019
Fixes microsoft#642. Reopens microsoft#619. Related microsoft#620. This unfilters exported variables except for things which are directly from typing or are imported modules, though even that may be too strong. The old LS didn't look at __all__ whatsoever, so maybe all of these should be allowed to come through; you tell me.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
numpy and tensorflow.nn are missing completion.
Nothing shows up after
np.
except some oddball stuff.Doing this:
nn
has no completion, andtensorflow.nn
itself doesn't say thatnn
exists at all.The text was updated successfully, but these errors were encountered: