Пример #1
0
    def draw(self):
        errorlist = self.doc.errorlist

        self.draw_line('Error list', self.create_attribute(alt_background=True))

        for i, (errortype, interval, message) in enumerate(errorlist):
            attribute = self.create_attribute()
            if self.doc.errorlist.current == i:
                attribute = self.create_attribute(reverse=True)
            line, column = position_to_coord(interval[0], self.doc.text)
            self.draw_line('{} at {},{}: {}'.format(errortype, line, column, message),
                           attribute)
Пример #2
0
 def complete(self):
     doc = self.doc
     debug(self.ycmhandle.IsReady())
     if self.ycmhandle.IsReady() and hasattr(doc, 'tempfile'):
         # It may happen that the server was not ready for parsing, but is ready now
         line, column = position_to_coord(doc.mode.cursor_position(doc), doc.text)
         info((line, column))
         result = doc.completer.SendCodeCompletionRequest(test_filename=doc.tempfile,
                                                          filetype=doc.filetype,
                                                          line_num=line,
                                                          column_num=column)
         completions = [item['insertion_text'] for item in result['completions']]
         start_column = result['completion_start_column']
         start_position = coord_to_position(line, start_column, doc.text)
         debug('startcolumn: {}'.format(start_column))
         debug('startpos: {}'.format(start_position))
         return start_position, completions