1
0
forked from VimPlug/jedi

Implement import for dotted types in dcostring

This commit is contained in:
Takafumi Arakaki
2013-01-30 01:12:45 +01:00
parent e12212942f
commit 9f416c9dae

View File

@@ -20,9 +20,20 @@ def follow_param(param):
func = param.parent_function
#print func, param, param.parent_function
param_str = search_param_in_docstr(func.docstr, str(param.get_name()))
user_position = (1, 0)
if param_str is not None:
p = parsing.PyFuzzyParser(param_str, None, (1, 0), no_docstr=True)
# Try to import module part in dotted name.
# (e.g., 'threading' in 'threading.Thread').
if '.' in param_str:
param_str = 'import {0}\n{1}'.format(
param_str.rsplit('.', 1)[0],
param_str)
user_position = (2, 0)
p = parsing.PyFuzzyParser(param_str, None, user_position,
no_docstr=True)
p.user_stmt.parent = func
return evaluate.follow_statement(p.user_stmt)
return []