1
0
forked from VimPlug/jedi

Fix an infer issue on literals after brackets, fixes #1657

This commit is contained in:
Dave Halter
2020-10-23 19:08:41 +02:00
parent 04572422d4
commit a5a36a049c
2 changed files with 37 additions and 0 deletions

View File

@@ -281,6 +281,11 @@ class Script:
leaf = self._module_node.get_leaf_for_position(pos)
if leaf is None or leaf.type == 'string':
return []
if leaf.end_pos == (line, column) and leaf.type == 'operator':
next_ = leaf.get_next_leaf()
if next_.start_pos == leaf.end_pos \
and next_.type in ('number', 'string', 'keyword'):
leaf = next_
context = self._get_module_context().create_context(leaf)