mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-16 02:27:06 +08:00
fix docstrings with evaluator stuff
This commit is contained in:
@@ -111,6 +111,8 @@ def find_return_types(evaluator, func):
|
||||
if match:
|
||||
return match.group(1)
|
||||
|
||||
from jedi.evaluate import representation as er
|
||||
|
||||
if isinstance(func, er.InstanceElement):
|
||||
func = func.var
|
||||
|
||||
@@ -125,4 +127,4 @@ def find_return_types(evaluator, func):
|
||||
if p.user_stmt is None:
|
||||
return []
|
||||
p.user_stmt.parent = func
|
||||
return list(evaluate.follow_statement(p.user_stmt))
|
||||
return list(evaluator.follow_statement(p.user_stmt))
|
||||
|
||||
@@ -255,12 +255,10 @@ class Evaluator(object):
|
||||
r = func.var.params[r.position_nr]
|
||||
|
||||
# add docstring knowledge
|
||||
"""
|
||||
doc_params = docstrings.follow_param(r) TODO ENABLE
|
||||
doc_params = docstrings.follow_param(self, r)
|
||||
if doc_params:
|
||||
res_new += doc_params
|
||||
continue
|
||||
"""
|
||||
|
||||
if not r.is_generated:
|
||||
res_new += dynamic.search_params(self, r)
|
||||
|
||||
@@ -508,10 +508,7 @@ class Execution(Executable):
|
||||
if func.is_generator and not evaluate_generator:
|
||||
return [Generator(self._evaluator, func, self.var_args)]
|
||||
else:
|
||||
"""
|
||||
stmts = docstrings.find_return_types(func)
|
||||
"""
|
||||
stmts=[]
|
||||
stmts = docstrings.find_return_types(self._evaluator, func)
|
||||
for r in self.returns:
|
||||
if r is not None:
|
||||
stmts += self._evaluator.follow_statement(r)
|
||||
|
||||
Reference in New Issue
Block a user