mirror of
https://github.com/davidhalter/jedi.git
synced 2026-05-25 01:38:36 +08:00
Call signatures should not fail when used on if(.
This commit is contained in:
@@ -505,6 +505,8 @@ class Script(object):
|
|||||||
return []
|
return []
|
||||||
|
|
||||||
stmt = self._get_under_cursor_stmt(call_txt)
|
stmt = self._get_under_cursor_stmt(call_txt)
|
||||||
|
if stmt is None:
|
||||||
|
return []
|
||||||
|
|
||||||
with common.scale_speed_settings(settings.scale_call_signatures):
|
with common.scale_speed_settings(settings.scale_call_signatures):
|
||||||
origins = cache.cache_call_signatures(self._evaluator, stmt, self.source,
|
origins = cache.cache_call_signatures(self._evaluator, stmt, self.source,
|
||||||
|
|||||||
@@ -192,6 +192,9 @@ class TestCallSignatures(TestCase):
|
|||||||
"""
|
"""
|
||||||
assert not Script('str(\ndef x').call_signatures()
|
assert not Script('str(\ndef x').call_signatures()
|
||||||
|
|
||||||
|
def test_flow_call(self):
|
||||||
|
assert not Script('if (1').call_signatures()
|
||||||
|
|
||||||
|
|
||||||
class TestParams(TestCase):
|
class TestParams(TestCase):
|
||||||
def params(self, source, line=None, column=None):
|
def params(self, source, line=None, column=None):
|
||||||
|
|||||||
Reference in New Issue
Block a user