1
0
forked from VimPlug/jedi

preload_module function for IDEs, to control which modules to load on startup, refs #102

This commit is contained in:
David Halter
2013-05-13 09:12:08 +04:30
parent b5b625ea14
commit 15885e8685
3 changed files with 35 additions and 6 deletions

View File

@@ -522,6 +522,18 @@ def defined_names(source, source_path=None, source_encoding='utf-8'):
return api_classes._defined_names(parser.scope)
def preload_module(*modules):
"""
Preloading modules tells Jedi to load a module now, instead of lazy parsing
of modules. Usful for IDEs, to control which modules to load on startup.
:param modules: different module names, list of string.
"""
for m in modules:
s = "import %s as x; x." % m
Script(s, 1, len(s), None).complete()
def set_debug_function(func_cb=debug.print_to_stdout, warnings=True,
notices=True, speed=True):
"""