forked from VimPlug/jedi
Fix issues with unreachable flows.
This benefits static analysis as well as autocompletion: Unreachable code (things like code within 'if 0:') should still be resolveable.
This commit is contained in:
@@ -182,3 +182,26 @@ isinst(1.0)
|
||||
isinst(False)
|
||||
#? int()
|
||||
isinst('')
|
||||
|
||||
# -----------------
|
||||
# flows that are not reachable should be able to access parent scopes.
|
||||
# -----------------
|
||||
|
||||
foobar = ''
|
||||
|
||||
if 0:
|
||||
within_flow = 1.0
|
||||
#? float()
|
||||
within_flow
|
||||
#? str()
|
||||
foobar
|
||||
if 0:
|
||||
nested = 1
|
||||
#? int()
|
||||
nested
|
||||
#? float()
|
||||
within_flow
|
||||
#? str()
|
||||
foobar
|
||||
#?
|
||||
nested
|
||||
|
||||
@@ -207,7 +207,7 @@ def test_signature_is_definition():
|
||||
# Now compare all the attributes that a CallSignature must also have.
|
||||
for attr_name in dir(definition):
|
||||
dont_scan = ['defined_names', 'line_nr', 'start_pos', 'documentation',
|
||||
'doc', 'parent']
|
||||
'doc', 'parent', 'goto_assignments']
|
||||
if attr_name.startswith('_') or attr_name in dont_scan:
|
||||
continue
|
||||
attribute = getattr(definition, attr_name)
|
||||
|
||||
Reference in New Issue
Block a user