当前位置: 首页>>代码示例>>Python>>正文


Python UltiSnips.UltiSnips_Manager类代码示例

本文整理汇总了Python中UltiSnips.UltiSnips_Manager的典型用法代码示例。如果您正苦于以下问题:Python UltiSnips_Manager类的具体用法?Python UltiSnips_Manager怎么用?Python UltiSnips_Manager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了UltiSnips_Manager类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: parse

    def parse(self, base):
        try:
            snips = UltiSnips_Manager._snips(base, True)
        except Exception:
            return []

        return [{
            'word': snip.trigger,
            'menu': ' '.join(['[snip]', snip.description]),
        } for snip in snips]
开发者ID:sagargp,项目名称:shdw,代码行数:10,代码来源:ultisnips.py

示例2: _AddUltiSnipsDataIfNeeded

def _AddUltiSnipsDataIfNeeded(extra_data):
    if not USE_ULTISNIPS_DATA:
        return

    try:
        # Since UltiSnips may run in a different python interpreter (python 3) than
        # YCM, UltiSnips_Manager singleton is not necessary the same as the one
        # used by YCM. In particular, it means that we cannot rely on UltiSnips to
        # set the current filetypes to the singleton. We need to do it ourself.
        UltiSnips_Manager.reset_buffer_filetypes()
        UltiSnips_Manager.add_buffer_filetypes(vimsupport.GetVariableValue("&filetype"))
        rawsnips = UltiSnips_Manager._snips("", True)
    except:
        return

    # UltiSnips_Manager._snips() returns a class instance where:
    # class.trigger - name of snippet trigger word ( e.g. defn or testcase )
    # class.description - description of the snippet
    extra_data["ultisnips_snippets"] = [{"trigger": x.trigger, "description": x.description} for x in rawsnips]
开发者ID:lining0806,项目名称:YouCompleteMe,代码行数:19,代码来源:youcompleteme.py

示例3: _GetCandidates

def _GetCandidates():
  try:
    rawsnips = UltiSnips_Manager._snips( '', 1 )

    # UltiSnips_Manager._snips() returns a class instance where:
    # class.trigger - name of snippet trigger word ( e.g. defn or testcase )
    # class.description - description of the snippet
    return  [ { 'word': str( snip.trigger ),
                'menu': str( '<snip> ' + snip.description ) }
              for snip in rawsnips ]
  except:
    return []
开发者ID:Chibin,项目名称:.vim,代码行数:12,代码来源:ultisnips_completer.py

示例4: _AddUltiSnipsDataIfNeeded

def _AddUltiSnipsDataIfNeeded(extra_data):
    if not USE_ULTISNIPS_DATA:
        return

    try:
        rawsnips = UltiSnips_Manager._snips("", 1)
    except:
        return

    # UltiSnips_Manager._snips() returns a class instance where:
    # class.trigger - name of snippet trigger word ( e.g. defn or testcase )
    # class.description - description of the snippet
    extra_data["ultisnips_snippets"] = [{"trigger": x.trigger, "description": x.description} for x in rawsnips]
开发者ID:axelmartensson,项目名称:YouCompleteMe,代码行数:13,代码来源:youcompleteme.py

示例5: parse

    def parse(self, base):
        token = self.input_data.split()[-1]
        try:
            snips = UltiSnips_Manager._snips(token, True)
        except Exception:
            return []
        candidates = [{
            'word': snip.trigger,
            'dup': 1,
            'menu': ' '.join(['[snip]', snip.description]),
        } for snip in snips]

        index = token.rfind(base)
        if index > 0 and candidates:
            prefix = len(token[:index])
            for c in candidates:
                c['abbr'] = c['word']
                c['word'] = c['word'][prefix:]
        return candidates
开发者ID:jalemolina,项目名称:vim,代码行数:19,代码来源:ultisnips.py

示例6: snippetsInit

def snippetsInit():
  global ultisnips_idx
  ultisnips_idx = 0
  UltiSnips_Manager.add_buffer_filetypes('%s.clang_complete' % vim.eval('&filetype'))
开发者ID:13609594236,项目名称:AcVim,代码行数:4,代码来源:ultisnips.py

示例7: snippetsReset

def snippetsReset():
  UltiSnips_Manager.clear_snippets(ft="clang_complete")
开发者ID:13609594236,项目名称:AcVim,代码行数:2,代码来源:ultisnips.py

示例8: snippetsTrigger

def snippetsTrigger():
  print vim.current.line
  UltiSnips_Manager.expand()
开发者ID:13609594236,项目名称:AcVim,代码行数:3,代码来源:ultisnips.py

示例9: snippetsAddSnippet

def snippetsAddSnippet(fullname, word, abbr):
  global ultisnips_idx
  ultisnips_idx = 0
  UltiSnips_Manager.add_snippet(fullname, word, fullname, "i", "clang_complete")
  return fullname
开发者ID:13609594236,项目名称:AcVim,代码行数:5,代码来源:ultisnips.py


注:本文中的UltiSnips.UltiSnips_Manager类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。