1
0
forked from VimPlug/jedi

Support mypy annotations using comment syntax

This allows us to use mypy annotations for completion in Python 2.

Closes #946
This commit is contained in:
Lee Danilek
2017-07-24 19:01:56 -07:00
committed by Wilfred Hughes
parent d0b8f9e5a2
commit b9903ede1b
3 changed files with 145 additions and 2 deletions

View File

@@ -201,6 +201,9 @@ def get_following_comment_same_line(node):
whitespace = node.children[5].get_first_leaf().prefix
elif node.type == 'with_stmt':
whitespace = node.children[3].get_first_leaf().prefix
elif node.type == 'funcdef':
# actually on the next line
whitespace = node.children[4].get_first_leaf().get_next_leaf().prefix
else:
whitespace = node.get_last_leaf().get_next_leaf().prefix
except AttributeError: