mirror of
https://github.com/davidhalter/jedi.git
synced 2026-01-04 19:23:20 +08:00
Merge pull request #74 from tkf/full_name-builtin
No __builtin__ prefix for BaseOutput.full_name
This commit is contained in:
@@ -16,7 +16,9 @@ class BaseOutput(object):
|
||||
'os2emxpath': 'os.path',
|
||||
'macpath': 'os.path',
|
||||
'genericpath': 'os.path',
|
||||
'_io': 'io'
|
||||
'_io': 'io',
|
||||
'__builtin__': '',
|
||||
'builtins': '',
|
||||
}
|
||||
|
||||
_tuple_mapping = dict((tuple(k.split('.')), v) for (k, v) in {
|
||||
@@ -101,7 +103,7 @@ class BaseOutput(object):
|
||||
if tuple(path[:len(key)]) == key:
|
||||
path = [repl] + path[len(key):]
|
||||
|
||||
return '.'.join(path)
|
||||
return '.'.join(path if path[0] else path[1:])
|
||||
|
||||
def __repr__(self):
|
||||
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 \
|
||||
== '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):
|
||||
s = """
|
||||
import re
|
||||
|
||||
Reference in New Issue
Block a user