diff --git a/jedi/evaluate.py b/jedi/evaluate.py index 47bc6ae8..f5d727a9 100644 --- a/jedi/evaluate.py +++ b/jedi/evaluate.py @@ -216,6 +216,9 @@ def find_name(scope, name_str, position=None, search_global=False, # so just ignore it. continue + if r.docstr: + res_new.append(r) + scopes = follow_statement(r, seek_name=name_str) add += remove_statements(scopes) diff --git a/test/regression.py b/test/regression.py index 313b6a30..e52793b2 100755 --- a/test/regression.py +++ b/test/regression.py @@ -338,8 +338,7 @@ class TestDocstring(TestBase): self.assertEqual(defs[0].raw_doc, 'Docstring of `func`.') def test_attribute_docstring(self): - # TODO: use self.definition - defs = self.goto(""" + defs = self.definition(""" x = None '''Docstring of `x`.''' x""")