This repository has been archived by the owner on Jan 19, 2025. It is now read-only.
List declarations under a public module if applicable #509
Labels
enhancement 💡
New feature or request
Is your feature request related to a problem? Please describe
Currently, we only store the module in the API data that contains a given declaration. However, other modules (particularly the
__init__.py
files) might import and, thus, also re-export a declaration. This behavior is already checked to determine whether a declaration is public or not. But in the editor, the declarations are still listed in the internal modules that declare them rather than the public ones that should be used instead. Implementation details like this should be hidden.Desired solution
Store all modules that provide access to a given declaration when the
api
command is run. In the editor list a declaration under one of the public modules if it exists. Otherwise, pick one of the private ones.Screenshots (optional)
Here we see, for example, the public class
SVR
listed underneath the private modulesklearn._svm.classes
. The module is private since one of the segments of its name (_svm
) starts with an underscore. However, the classSVR
is also available undersklearn.svm
. This is the module that should appear in the tree view as its parent.Additional Context
Maybe store an additional property "reexported_by" in the API data that stores a list of the names of modules that reexport a declaration.
The text was updated successfully, but these errors were encountered: