forked from VimPlug/jedi
Merge branch 'get_code_fidelity' of git://github.com/ganwell/jedi into ganwell
This commit is contained in:
@@ -9,6 +9,7 @@ import inspect
|
||||
|
||||
from jedi._compatibility import is_py3, builtins
|
||||
from jedi.parser import Parser
|
||||
from jedi.parser import token as token_pr
|
||||
from jedi.parser.representation import Class
|
||||
from jedi.evaluate.helpers import FakeName
|
||||
|
||||
@@ -102,7 +103,9 @@ def get_faked(module, obj, name=None):
|
||||
if not isinstance(result, Class) and result is not None:
|
||||
# Set the docstr which was previously not set (faked modules don't
|
||||
# contain it).
|
||||
result.docstr = obj.__doc__ or ''
|
||||
result.docstr = None
|
||||
if obj.__doc__:
|
||||
result.docstr = token_pr.TokenDocstring.fake_docstring(obj.__doc__)
|
||||
return result
|
||||
|
||||
|
||||
|
||||
@@ -36,7 +36,12 @@ REST_ROLE_PATTERN = re.compile(r':[^`]+:`([^`]+)`')
|
||||
def follow_param(evaluator, param):
|
||||
func = param.parent_function
|
||||
# print func, param, param.parent_function
|
||||
param_str = _search_param_in_docstr(func.docstr, str(param.get_name()))
|
||||
if not func.docstr:
|
||||
return []
|
||||
param_str = _search_param_in_docstr(
|
||||
func.docstr.as_string(),
|
||||
str(param.get_name())
|
||||
)
|
||||
position = (1, 0)
|
||||
|
||||
if param_str is not None:
|
||||
@@ -112,7 +117,9 @@ def find_return_types(evaluator, func):
|
||||
if match:
|
||||
return match.group(1)
|
||||
|
||||
type_str = search_return_in_docstr(func.docstr)
|
||||
if not func.docstr:
|
||||
return []
|
||||
type_str = search_return_in_docstr(func.docstr.as_string())
|
||||
if not type_str:
|
||||
return []
|
||||
|
||||
|
||||
Reference in New Issue
Block a user