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


Python UltiSnips_Manager.add_buffer_filetypes方法代码示例

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


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

示例1: _AddUltiSnipsDataIfNeeded

# 需要导入模块: from UltiSnips import UltiSnips_Manager [as 别名]
# 或者: from UltiSnips.UltiSnips_Manager import add_buffer_filetypes [as 别名]
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,代码行数:21,代码来源:youcompleteme.py

示例2: snippetsInit

# 需要导入模块: from UltiSnips import UltiSnips_Manager [as 别名]
# 或者: from UltiSnips.UltiSnips_Manager import add_buffer_filetypes [as 别名]
def snippetsInit():
  global ultisnips_idx
  ultisnips_idx = 0
  UltiSnips_Manager.add_buffer_filetypes('%s.clang_complete' % vim.eval('&filetype'))
开发者ID:13609594236,项目名称:AcVim,代码行数:6,代码来源:ultisnips.py


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