mirror of
https://github.com/davidhalter/jedi.git
synced 2026-10-14 05:28:57 +08:00
Support case like from os.path import join as pjoin
This commit is contained in:
1 parent
6fb42e5f4b
commit
fc79f0e258
2 files changed
+7
-1
No files matched your search
+2
-1
@@ -576,7 +576,8 @@ class Interpreter(Script):
|
|||||||
# Import functions and classes
|
# Import functions and classes
|
||||||
module = getattr(obj, '__module__', None)
|
module = getattr(obj, '__module__', None)
|
||||||
if module:
|
if module:
|
||||||
fakeimport = self._make_fakeimport(module, variable)
|
fakeimport = self._make_fakeimport(module, obj.__name__,
|
||||||
|
variable)
|
||||||
scope.add_import(fakeimport)
|
scope.add_import(fakeimport)
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
|||||||
@@ -553,6 +553,11 @@ class TestInterpreterAPI(unittest.TestCase):
|
|||||||
{'join': os.path.join},
|
{'join': os.path.join},
|
||||||
['upper'])
|
['upper'])
|
||||||
|
|
||||||
|
def test_complete_raw_function_different_name(self):
|
||||||
|
self.check_interpreter_complete('pjoin().up',
|
||||||
|
{'pjoin': os.path.join},
|
||||||
|
['upper'])
|
||||||
|
|
||||||
def test_complete_raw_module(self):
|
def test_complete_raw_module(self):
|
||||||
self.check_interpreter_complete('os.path.join().up',
|
self.check_interpreter_complete('os.path.join().up',
|
||||||
{'os': os},
|
{'os': os},
|
||||||
|
|||||||
Reference in new issue
Block a user