mirror of
https://github.com/davidhalter/jedi.git
synced 2026-09-29 00:12:21 +08:00
+1
-1
@@ -551,7 +551,7 @@ class BaseName:
|
||||
return ''.join(lines[start_index:index + after + 1])
|
||||
|
||||
def _get_signatures(self, for_docstring=False):
|
||||
if self._name.api_type == 'property':
|
||||
if self._name.api_type in ('property', 'param'):
|
||||
return []
|
||||
if for_docstring and self._name.api_type == 'statement' and not self.is_stub():
|
||||
# For docstrings we don't resolve signatures if they are simple
|
||||
|
||||
@@ -462,3 +462,21 @@ def test_module_completions(Script, module):
|
||||
|
||||
def test_whitespace_at_end_after_dot(Script):
|
||||
assert 'strip' in [c.name for c in Script('str. ').complete()]
|
||||
|
||||
|
||||
def test_param_docstring_in_completion(Script):
|
||||
# From Github #2063
|
||||
code = '''\
|
||||
from typing import Optional
|
||||
|
||||
def func(arg: Optional[int]):
|
||||
pass
|
||||
|
||||
func(arg'''
|
||||
script = Script(code=code)
|
||||
completions = script.complete(
|
||||
line=len(code.splitlines()),
|
||||
column=len(code.splitlines()[-1])
|
||||
)
|
||||
c, = completions
|
||||
assert c.docstring() == ''
|
||||
|
||||
Reference in New Issue
Block a user