mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-06 22:14:27 +08:00
remove strange Definition.description length limitation
This commit is contained in:
@@ -510,9 +510,7 @@ class Definition(BaseDefinition):
|
|||||||
elif self.is_keyword:
|
elif self.is_keyword:
|
||||||
d = 'keyword %s' % d.name
|
d = 'keyword %s' % d.name
|
||||||
else:
|
else:
|
||||||
code = d.get_code().replace('\n', '')
|
d = d.get_code().replace('\n', '')
|
||||||
max_len = 20
|
|
||||||
d = (code[:max_len] + '...') if len(code) > max_len + 3 else code
|
|
||||||
return d
|
return d
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@@ -604,4 +602,4 @@ class Param(Definition):
|
|||||||
A function to get the whole code of the param. We might deprecate this
|
A function to get the whole code of the param. We might deprecate this
|
||||||
function in the future, use :attr:`.description` instead.
|
function in the future, use :attr:`.description` instead.
|
||||||
"""
|
"""
|
||||||
return self._definition.get_code()
|
return self.description
|
||||||
|
|||||||
@@ -180,7 +180,7 @@ for i in range(1):
|
|||||||
i
|
i
|
||||||
|
|
||||||
for key, value in [(1,2)]:
|
for key, value in [(1,2)]:
|
||||||
#! ['for key,value in [(1...']
|
#! ['for key,value in [(1, 2)]: key']
|
||||||
key
|
key
|
||||||
|
|
||||||
for i in []:
|
for i in []:
|
||||||
|
|||||||
@@ -157,7 +157,7 @@ class TestCallSignatures(TestCase):
|
|||||||
signatures = Script(s).call_signatures()
|
signatures = Script(s).call_signatures()
|
||||||
assert len(signatures) == 1
|
assert len(signatures) == 1
|
||||||
x = [p.get_code() for p in signatures[0].params]
|
x = [p.get_code() for p in signatures[0].params]
|
||||||
assert x == ['*args\n']
|
assert x == ['*args']
|
||||||
|
|
||||||
|
|
||||||
class TestParams(TestCase):
|
class TestParams(TestCase):
|
||||||
|
|||||||
Reference in New Issue
Block a user