diff --git a/jedi/api/classes.py b/jedi/api/classes.py index 012d92bf..4b467aac 100644 --- a/jedi/api/classes.py +++ b/jedi/api/classes.py @@ -510,9 +510,7 @@ class Definition(BaseDefinition): elif self.is_keyword: d = 'keyword %s' % d.name else: - code = d.get_code().replace('\n', '') - max_len = 20 - d = (code[:max_len] + '...') if len(code) > max_len + 3 else code + d = d.get_code().replace('\n', '') return d @property @@ -604,4 +602,4 @@ class Param(Definition): A function to get the whole code of the param. We might deprecate this function in the future, use :attr:`.description` instead. """ - return self._definition.get_code() + return self.description diff --git a/test/completion/goto.py b/test/completion/goto.py index 49e383f1..942cee7c 100644 --- a/test/completion/goto.py +++ b/test/completion/goto.py @@ -180,7 +180,7 @@ for i in range(1): i for key, value in [(1,2)]: - #! ['for key,value in [(1...'] + #! ['for key,value in [(1, 2)]: key'] key for i in []: diff --git a/test/test_api/test_call_signatures.py b/test/test_api/test_call_signatures.py index 0b13c0d6..225c3e72 100644 --- a/test/test_api/test_call_signatures.py +++ b/test/test_api/test_call_signatures.py @@ -157,7 +157,7 @@ class TestCallSignatures(TestCase): signatures = Script(s).call_signatures() assert len(signatures) == 1 x = [p.get_code() for p in signatures[0].params] - assert x == ['*args\n'] + assert x == ['*args'] class TestParams(TestCase):