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


TypeScript Neovim.getVar方法代码示例

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


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

示例1: getItems

 public async getItems(): Promise<VimCompleteItem[]> {
   let visible = await this.pumvisible()
   if (!visible) return []
   let context = await this.nvim.getVar('coc#_context') as any
   let items = context.candidates
   return items || []
 }
开发者ID:demelev,项目名称:coc.nvim,代码行数:7,代码来源:helper.ts

示例2: visible

 public async visible(word: string, source?: string): Promise<boolean> {
   await this.waitPopup()
   let context = await this.nvim.getVar('coc#_context') as any
   let items = context.candidates
   if (!items) return false
   let item = items.find(o => o.word == word)
   if (!item || !item.user_data) return false
   try {
     let o = JSON.parse(item.user_data)
     if (source && o.source !== source) {
       return false
     }
   } catch (e) {
     return false
   }
   return true
 }
开发者ID:demelev,项目名称:coc.nvim,代码行数:17,代码来源:helper.ts

示例3: it

 it('should fix start column', async () => {
   await helper.edit()
   let source: ISource = {
     name: 'test',
     priority: 10,
     enable: true,
     firstMatch: false,
     sourceType: SourceType.Native,
     triggerCharacters: [],
     doComplete: async (): Promise<CompleteResult> => {
       let result: CompleteResult = {
         startcol: 0,
         items: [{ word: 'foo.bar' }]
       }
       return Promise.resolve(result)
     }
   }
   sources.addSource(source)
   await nvim.setLine('foo.')
   await nvim.input('Ab')
   await helper.waitPopup()
   let val = await nvim.getVar('coc#_context') as any
   expect(val.start).toBe(0)
 })
开发者ID:illarionvk,项目名称:dotfiles,代码行数:24,代码来源:basic.test.ts

示例4: items

 public async items(): Promise<VimCompleteItem[]> {
   let context = await this.nvim.getVar('coc#_context')
   return context['candidates'] || []
 }
开发者ID:demelev,项目名称:coc.nvim,代码行数:4,代码来源:helper.ts


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