From 0243746143bf79804f871ea7e4fc983b9ab39365 Mon Sep 17 00:00:00 2001 From: Herrington Darkholme Date: Sun, 22 Nov 2015 00:15:45 +0800 Subject: [PATCH] Add support for deoplete --- rplugin/python3/deoplete/sources/ultisnips.py | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 rplugin/python3/deoplete/sources/ultisnips.py diff --git a/rplugin/python3/deoplete/sources/ultisnips.py b/rplugin/python3/deoplete/sources/ultisnips.py new file mode 100644 index 0000000..943b3aa --- /dev/null +++ b/rplugin/python3/deoplete/sources/ultisnips.py @@ -0,0 +1,20 @@ +from .base import Base + +class Source(Base): + def __init__(self, vim): + Base.__init__(self, vim) + + self.name = 'ultisnips' + self.mark = '[US]' + self.rank = 8 + + def gather_candidates(self, context): + suggestions = [] + snippets = self.vim.eval( + 'UltiSnips#SnippetsInCurrentScope()') + for trigger in snippets: + suggestions.append({ + 'word': trigger, + 'menu': self.mark + ' ' + snippets.get(trigger, '') + }) + return suggestions