mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-06 14:04:26 +08:00
temporary solution for completions in asserts
This commit is contained in:
@@ -566,6 +566,7 @@ class Parser(object):
|
||||
stmt, tok = self._parse_statement()
|
||||
if stmt is not None:
|
||||
stmt.parent = use_as_parent_scope
|
||||
self._scope.statements.append(stmt)
|
||||
self._scope.asserts.append(stmt)
|
||||
elif tok_str in STATEMENT_KEYWORDS:
|
||||
stmt, _ = self._parse_statement()
|
||||
|
||||
@@ -820,6 +820,9 @@ class KeywordStatement(Base):
|
||||
if stmt is not None:
|
||||
stmt.parent = self
|
||||
|
||||
def is_scope(self):
|
||||
return False
|
||||
|
||||
def __repr__(self):
|
||||
return "<%s(%s): %s>" % (type(self).__name__, self.name, self.stmt)
|
||||
|
||||
|
||||
@@ -43,6 +43,14 @@ def func():
|
||||
#? int() str()
|
||||
func()
|
||||
|
||||
# -----------------
|
||||
# keywords
|
||||
# -----------------
|
||||
|
||||
#? list()
|
||||
assert []
|
||||
|
||||
|
||||
# -----------------
|
||||
# for loops
|
||||
# -----------------
|
||||
|
||||
Reference in New Issue
Block a user