forked from VimPlug/jedi
updated complete interface
This commit is contained in:
@@ -30,12 +30,16 @@ class Completion(object):
|
||||
dot = '.' if self.needs_dot else ''
|
||||
return dot + self.name.names[-1][self.like_name_length:]
|
||||
|
||||
@property
|
||||
def word(self):
|
||||
return str(self.name.names[-1])
|
||||
|
||||
@property
|
||||
def description(self):
|
||||
return str(self.name.parent())
|
||||
|
||||
@property
|
||||
def help(self):
|
||||
def doc(self):
|
||||
try:
|
||||
return str(self.name.parent().docstr)
|
||||
except AttributeError:
|
||||
@@ -65,9 +69,6 @@ class Completion(object):
|
||||
|
||||
return ''
|
||||
|
||||
def __str__(self):
|
||||
return self.name.names[-1]
|
||||
|
||||
|
||||
class Definition(object):
|
||||
def __init__(self, definition):
|
||||
|
||||
@@ -48,14 +48,14 @@ if 1:
|
||||
completions = functions.complete(source, row, column, buf_path)
|
||||
out = []
|
||||
for c in completions:
|
||||
d = dict(word=str(c),
|
||||
abbr=str(c),
|
||||
d = dict(word=base + c.complete,
|
||||
abbr=c.word,
|
||||
# stuff directly behind the completion
|
||||
menu=PythonToVimStr(c.description),
|
||||
info=PythonToVimStr(c.help), # docstr
|
||||
info=PythonToVimStr(c.doc), # docstr
|
||||
kind=c.get_vim_type(), # completion type
|
||||
icase=1, # case insensitive
|
||||
dup=1, # allow duplicates (maybe later remove this)
|
||||
dup=1 # allow duplicates (maybe later remove this)
|
||||
)
|
||||
out.append(d)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user