mirror of
https://github.com/davidhalter/jedi.git
synced 2026-05-18 14:29:40 +08:00
temporary fix for #315. in the future we should be removing that whole indent change crap
This commit is contained in:
@@ -248,9 +248,13 @@ class Script(object):
|
|||||||
stmt = r.module.statements[-1]
|
stmt = r.module.statements[-1]
|
||||||
except IndexError:
|
except IndexError:
|
||||||
raise NotFoundError()
|
raise NotFoundError()
|
||||||
# Set the start_pos to a pseudo position, that doesn't exist but works
|
user_stmt = self._parser.user_stmt()
|
||||||
# perfectly well (for both completions in docstrings and statements).
|
if user_stmt is None or isinstance(user_stmt, pr.Param):
|
||||||
stmt.start_pos = self._pos
|
# Set the start_pos to a pseudo position, that doesn't exist but works
|
||||||
|
# perfectly well (for both completions in docstrings and statements).
|
||||||
|
stmt.start_pos = self._pos
|
||||||
|
else:
|
||||||
|
stmt.start_pos = user_stmt.start_pos[0], user_stmt.start_pos[1] - 1
|
||||||
stmt.parent = self._parser.user_scope()
|
stmt.parent = self._parser.user_scope()
|
||||||
return stmt
|
return stmt
|
||||||
|
|
||||||
|
|||||||
@@ -93,7 +93,7 @@ ClassVar().x = ''
|
|||||||
|
|
||||||
# Recurring use of the same var name, github #315
|
# Recurring use of the same var name, github #315
|
||||||
def f(t=None):
|
def f(t=None):
|
||||||
#! 9 ['t=None']
|
#! 9 ['t = None']
|
||||||
t = t or 1
|
t = t or 1
|
||||||
|
|
||||||
# -----------------
|
# -----------------
|
||||||
|
|||||||
Reference in New Issue
Block a user