forked from VimPlug/jedi
Merge branch 'dev' of github.com:davidhalter/jedi into dev
This commit is contained in:
+4
-2
@@ -16,7 +16,9 @@ class BaseOutput(object):
|
|||||||
'os2emxpath': 'os.path',
|
'os2emxpath': 'os.path',
|
||||||
'macpath': 'os.path',
|
'macpath': 'os.path',
|
||||||
'genericpath': 'os.path',
|
'genericpath': 'os.path',
|
||||||
'_io': 'io'
|
'_io': 'io',
|
||||||
|
'__builtin__': '',
|
||||||
|
'builtins': '',
|
||||||
}
|
}
|
||||||
|
|
||||||
_tuple_mapping = dict((tuple(k.split('.')), v) for (k, v) in {
|
_tuple_mapping = dict((tuple(k.split('.')), v) for (k, v) in {
|
||||||
@@ -101,7 +103,7 @@ class BaseOutput(object):
|
|||||||
if tuple(path[:len(key)]) == key:
|
if tuple(path[:len(key)]) == key:
|
||||||
path = [repl] + path[len(key):]
|
path = [repl] + path[len(key):]
|
||||||
|
|
||||||
return '.'.join(path)
|
return '.'.join(path if path[0] else path[1:])
|
||||||
|
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
return "<%s %s>" % (type(self).__name__, self.description)
|
return "<%s %s>" % (type(self).__name__, self.description)
|
||||||
|
|||||||
@@ -234,6 +234,9 @@ class TestFeature(Base):
|
|||||||
assert self.complete('import os; os.path.join')[0].full_name \
|
assert self.complete('import os; os.path.join')[0].full_name \
|
||||||
== 'os.path.join'
|
== 'os.path.join'
|
||||||
|
|
||||||
|
def test_full_name_builtin(self):
|
||||||
|
self.assertEqual(self.complete('type')[0].full_name, 'type')
|
||||||
|
|
||||||
def test_full_name_tuple_mapping(self):
|
def test_full_name_tuple_mapping(self):
|
||||||
s = """
|
s = """
|
||||||
import re
|
import re
|
||||||
|
|||||||
Reference in New Issue
Block a user