forked from VimPlug/jedi
Include statements to Script.definition if it has docstring
This commit is contained in:
@@ -216,6 +216,9 @@ def find_name(scope, name_str, position=None, search_global=False,
|
|||||||
# so just ignore it.
|
# so just ignore it.
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
if r.docstr:
|
||||||
|
res_new.append(r)
|
||||||
|
|
||||||
scopes = follow_statement(r, seek_name=name_str)
|
scopes = follow_statement(r, seek_name=name_str)
|
||||||
add += remove_statements(scopes)
|
add += remove_statements(scopes)
|
||||||
|
|
||||||
|
|||||||
@@ -338,8 +338,7 @@ class TestDocstring(TestBase):
|
|||||||
self.assertEqual(defs[0].raw_doc, 'Docstring of `func`.')
|
self.assertEqual(defs[0].raw_doc, 'Docstring of `func`.')
|
||||||
|
|
||||||
def test_attribute_docstring(self):
|
def test_attribute_docstring(self):
|
||||||
# TODO: use self.definition
|
defs = self.definition("""
|
||||||
defs = self.goto("""
|
|
||||||
x = None
|
x = None
|
||||||
'''Docstring of `x`.'''
|
'''Docstring of `x`.'''
|
||||||
x""")
|
x""")
|
||||||
|
|||||||
Reference in New Issue
Block a user