示例#1
0
    def __init__(self, area, *args, **kwargs):
        pattern     = area.get(*area.get_seq_range())
        completions = [ind[1][0] for ind in area.find_all(root, '[^ ]*%s[^ ]*' % pattern 
        if pattern else '[^ ]+', nocase=True)]

        completions = set(completions)
        completions = [Option(ind) for ind in completions]

        CompletionWindow.__init__(self, area, 
        completions, *args, **kwargs)
示例#2
0
    def __init__(self, area, *args, **kwargs):
        pattern = area.get_seq()
        completions = map(
            lambda ind: ind[1][0],
            area.find_all(root,
                          '[^ ]*%s[^ ]*' % pattern if pattern else '[^ ]+',
                          nocase=True))

        completions = set(completions)
        completions = map(lambda ind: Option(ind), completions)

        CompletionWindow.__init__(self, area, completions, *args, **kwargs)
示例#3
0
 def build_docs(self, data):
     return [
         Option(ind.get('insertion_text', ''), self.fmt_option(ind))
         for ind in data['completions']
     ]
示例#4
0
 def build(self, data):
     data = json.loads(data)
     return map(lambda ind: Option(ind['name']), data['completions'])
示例#5
0
 def build(self, data):
     data = json.loads(data)
     return map(lambda ind: Option(ind['name'], 'Type:%s' % ind['type'], 
     'Class:%s' % ind['class']), data[1])
示例#6
0
 def build(self, data):
     data = json.loads(data)
     return [Option(ind['name'], 'Type:%s' % ind['type'], 
     'Class:%s' % ind['class']) for ind in data[1]]
示例#7
0
 def build(self, data):
     data = json.loads(data)
     return [Option(ind['name']) for ind in data['completions']]
示例#8
0
文件: completer.py 项目: smiled0g/vy
 def build(self, data):
     data = json.loads(data)
     return [Option(**ind) for ind in data['completions']]