forked from VimPlug/jedi
Unconditionally set attribute docstrings
As Statement.assignment_details triggers parsing inside statement let's don't check assignment_details when setting attribute docstrings.
This commit is contained in:
@@ -403,11 +403,8 @@ class Parser(object):
|
|||||||
not stmt.used_vars and
|
not stmt.used_vars and
|
||||||
len(stmt.token_list) == 1 and
|
len(stmt.token_list) == 1 and
|
||||||
first_tok[0] == tokenize.STRING):
|
first_tok[0] == tokenize.STRING):
|
||||||
# ... and the last statement was assignment
|
|
||||||
last_stmt = self.scope.statements[-1]
|
|
||||||
if last_stmt.assignment_details[0][1] == '=':
|
|
||||||
# ... then set it as a docstring
|
# ... then set it as a docstring
|
||||||
last_stmt.add_docstr(first_tok[1])
|
self.scope.statements[-1].add_docstr(first_tok[1])
|
||||||
except (IndexError, AttributeError):
|
except (IndexError, AttributeError):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user