My project add some const variables to __builtins__ dict. I want pycharm to recognize these symbols: provide code completion and reference. Right now I can add those variables one by one by implementing PyReferenceResolveProvider and hardcode every symbol with where they are defined. But there are a lot of declarations across different files. I think it is possible to scan the project finding all apperance of __builtins__ and store them in a cache, so when resolving such symbols, the plugin can easily find the source without searching across the whole project.
Is there a proper way to implement such feature?
def __init__(self, _a):
self.a = _a
__builtins__["INFO"] = InfoHandler(1)
print INFO.a # 1