File: ultisnips.py

package info (click to toggle)
vim-ultisnips 3.2-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,924 kB
  • sloc: python: 8,353; sh: 64; makefile: 38
file content (25 lines) | stat: -rw-r--r-- 681 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
from .base import Base


class Source(Base):
    def __init__(self, vim):
        Base.__init__(self, vim)

        self.name = "ultisnips"
        self.mark = "[US]"
        self.rank = 8
        self.is_volatile = True

    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, ""),
                    "dup": 1,
                    "kind": "snippet",
                }
            )
        return suggestions