2015-11-21 11:15:45 -05:00
|
|
|
from .base import Base
|
|
|
|
|
|
|
|
class Source(Base):
|
|
|
|
def __init__(self, vim):
|
|
|
|
Base.__init__(self, vim)
|
|
|
|
|
|
|
|
self.name = 'ultisnips'
|
|
|
|
self.mark = '[US]'
|
|
|
|
self.rank = 8
|
2018-03-30 14:37:02 -04:00
|
|
|
self.is_volatile = True
|
2015-11-21 11:15:45 -05:00
|
|
|
|
|
|
|
def gather_candidates(self, context):
|
|
|
|
suggestions = []
|
|
|
|
snippets = self.vim.eval(
|
|
|
|
'UltiSnips#SnippetsInCurrentScope()')
|
|
|
|
for trigger in snippets:
|
|
|
|
suggestions.append({
|
|
|
|
'word': trigger,
|
2016-01-22 16:32:59 -05:00
|
|
|
'menu': self.mark + ' ' + snippets.get(trigger, ''),
|
|
|
|
'dup': 1
|
2015-11-21 11:15:45 -05:00
|
|
|
})
|
|
|
|
return suggestions
|