-
Notifications
You must be signed in to change notification settings - Fork 133
Stubs aren't analyzed before their modules #907
Comments
The underlying issue for PyQt5 actually seems to be the size; we'll probably start treating library stubs specially to help this (but this issue still stands). |
No repro so far. Feel free to reopen it if you see it. |
I think this might be because producer in the walker has all modules in the same list and may happen to produce module before its stub. Perhaps separate higher priority queue of stubs would help or making graph of stubs for the graph of modules and processing it before modules? Also, in case of parallel tasks task for the module might start before task for the stub? |
Modules can't be produced before stubs unless there is a loop from some stub to that module, which is unlikely. Analysis will be empty if there is an error in analysis itself. In this case, we don't crash LS or terminate analysis session, but there should be a record in the log. |
Events:
if (!TryCreateModuleStub(name, moduleImport.ModulePath, out var stub)) {
stub = _interpreter.TypeshedResolution.GetOrLoadModule(moduleImport.IsBuiltin ? name : moduleImport.FullName);
}
later |
Need to check with #1470, may have been fixed. |
Haven't seen it for a while, there is an assert there that does not trigger. |
This affects PyQt5 pretty heavily.
This module has a stub next to it, which was added to the module by
TryCreateModuleStub
, but this stub was never analyzed (the state is atAnalyzing
) and has an empty analysis. This leaves the LS to spend all its in the ModuleSymbolTable with 30k+ evaluators to process.The text was updated successfully, but these errors were encountered: