本文整理汇总了Python中UltiSnips.UltiSnips_Manager.reset_buffer_filetypes方法的典型用法代码示例。如果您正苦于以下问题:Python UltiSnips_Manager.reset_buffer_filetypes方法的具体用法?Python UltiSnips_Manager.reset_buffer_filetypes怎么用?Python UltiSnips_Manager.reset_buffer_filetypes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UltiSnips.UltiSnips_Manager
的用法示例。
在下文中一共展示了UltiSnips_Manager.reset_buffer_filetypes方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _AddUltiSnipsDataIfNeeded
# 需要导入模块: from UltiSnips import UltiSnips_Manager [as 别名]
# 或者: from UltiSnips.UltiSnips_Manager import reset_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]