mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-09 07:14:48 +08:00
Always cast pr to er in _follow_statements_imports
This commit is contained in:
@@ -23,5 +23,6 @@ srusskih (@srusskih)
|
|||||||
Steven Silvester (@blink1073)
|
Steven Silvester (@blink1073)
|
||||||
Colin Duquesnoy (@ColinDuquesnoy) <colin.duquesnoy@gmail.com>
|
Colin Duquesnoy (@ColinDuquesnoy) <colin.duquesnoy@gmail.com>
|
||||||
Jorgen Schaefer (@jorgenschaefer) <contact@jorgenschaefer.de>
|
Jorgen Schaefer (@jorgenschaefer) <contact@jorgenschaefer.de>
|
||||||
|
Fredrik Bergroth (@fbergroth)
|
||||||
|
|
||||||
Note: (@user) means a github user name.
|
Note: (@user) means a github user name.
|
||||||
|
|||||||
@@ -307,6 +307,7 @@ class BaseDefinition(object):
|
|||||||
stripped = self._definition
|
stripped = self._definition
|
||||||
if isinstance(stripped, pr.Name):
|
if isinstance(stripped, pr.Name):
|
||||||
stripped = stripped.parent
|
stripped = stripped.parent
|
||||||
|
|
||||||
# We should probably work in `Finder._names_to_types` here.
|
# We should probably work in `Finder._names_to_types` here.
|
||||||
if isinstance(stripped, pr.Function):
|
if isinstance(stripped, pr.Function):
|
||||||
stripped = er.Function(self._evaluator, stripped)
|
stripped = er.Function(self._evaluator, stripped)
|
||||||
|
|||||||
@@ -127,6 +127,11 @@ def test_completion_docstring():
|
|||||||
assert c.docstring(raw=True, fast=False) == cleandoc(Script.__doc__)
|
assert c.docstring(raw=True, fast=False) == cleandoc(Script.__doc__)
|
||||||
|
|
||||||
|
|
||||||
|
def test_completion_params():
|
||||||
|
c = Script('import string; string.capwords').completions()[0]
|
||||||
|
assert [p.name for p in c.params] == ['s', 'sep']
|
||||||
|
|
||||||
|
|
||||||
def test_signature_params():
|
def test_signature_params():
|
||||||
def check(defs):
|
def check(defs):
|
||||||
params = defs[0].params
|
params = defs[0].params
|
||||||
|
|||||||
Reference in New Issue
Block a user