1
0
forked from VimPlug/jedi

updated complete interface

This commit is contained in:
David Halter
2012-08-31 17:38:21 +02:00
parent 3a8754b9f1
commit 654b845e71
2 changed files with 9 additions and 8 deletions

View File

@@ -30,12 +30,16 @@ class Completion(object):
dot = '.' if self.needs_dot else '' dot = '.' if self.needs_dot else ''
return dot + self.name.names[-1][self.like_name_length:] return dot + self.name.names[-1][self.like_name_length:]
@property
def word(self):
return str(self.name.names[-1])
@property @property
def description(self): def description(self):
return str(self.name.parent()) return str(self.name.parent())
@property @property
def help(self): def doc(self):
try: try:
return str(self.name.parent().docstr) return str(self.name.parent().docstr)
except AttributeError: except AttributeError:
@@ -65,9 +69,6 @@ class Completion(object):
return '' return ''
def __str__(self):
return self.name.names[-1]
class Definition(object): class Definition(object):
def __init__(self, definition): def __init__(self, definition):

View File

@@ -48,14 +48,14 @@ if 1:
completions = functions.complete(source, row, column, buf_path) completions = functions.complete(source, row, column, buf_path)
out = [] out = []
for c in completions: for c in completions:
d = dict(word=str(c), d = dict(word=base + c.complete,
abbr=str(c), abbr=c.word,
# stuff directly behind the completion # stuff directly behind the completion
menu=PythonToVimStr(c.description), menu=PythonToVimStr(c.description),
info=PythonToVimStr(c.help), # docstr info=PythonToVimStr(c.doc), # docstr
kind=c.get_vim_type(), # completion type kind=c.get_vim_type(), # completion type
icase=1, # case insensitive icase=1, # case insensitive
dup=1, # allow duplicates (maybe later remove this) dup=1 # allow duplicates (maybe later remove this)
) )
out.append(d) out.append(d)