From 5021a6bee91d104a0bea9a5ea16864fb2fe89305 Mon Sep 17 00:00:00 2001 From: David Halter Date: Mon, 1 Oct 2012 10:03:48 +0200 Subject: [PATCH] added a new option: dynamic_params_for_other_modules --- jedi/dynamic.py | 23 ++++++++++++----------- jedi/settings.py | 2 ++ 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/jedi/dynamic.py b/jedi/dynamic.py index 509bf42d..24c39bb8 100644 --- a/jedi/dynamic.py +++ b/jedi/dynamic.py @@ -48,18 +48,19 @@ def get_directory_modules_for_name(mods, name): mod_paths.add(m.path) yield m - paths = set(settings.additional_dynamic_modules) - for p in mod_paths: - d = os.path.dirname(p) - for entry in os.listdir(d): - if entry not in mod_paths: - if entry.endswith('.py'): - paths.add(d + os.path.sep + entry) + if settings.dynamic_params_for_other_modules: + paths = set(settings.additional_dynamic_modules) + for p in mod_paths: + d = os.path.dirname(p) + for entry in os.listdir(d): + if entry not in mod_paths: + if entry.endswith('.py'): + paths.add(d + os.path.sep + entry) - for p in paths: - c = check_python_file(p) - if c is not None and c not in mods: - yield c + for p in paths: + c = check_python_file(p) + if c is not None and c not in mods: + yield c def search_param_memoize(func): diff --git a/jedi/settings.py b/jedi/settings.py index 30b469db..7981f62a 100644 --- a/jedi/settings.py +++ b/jedi/settings.py @@ -27,6 +27,8 @@ dynamic_array_additions = True # A dynamic param completion, finds the callees of the function, which define # the params of a function. dynamic_params = True +# Do the same for other modules. +dynamic_params_for_other_modules = True # Additional modules in which Jedi checks if statements are to be found. This # is practical for IDE's, that want to administrate their modules themselves.