

def run(self, _edit):
    _region = sublime.Region(0, self.view.size())
    content = self.view.substr(_region)
    contentA = []
    for cTodo in RE_TODO_EXISTING.finditer(content):
        contentA.append(cTodo)
    for cTodo in reversed(contentA):
        regionTodo = sublime.Region(cTodo.end('prefix'), cTodo.end('comment'))
        cId = cTodo.group('id')
        if (not self.todoValidate(cId, cTodo.group('state'), cTodo.group('tags'), cTodo.group('priority'), cTodo.group('comment'))):
            storedTask = WCache().getDB().todoA[int(commentType)]
            commentType = self.view.substr(sublime.Region(cTodo.end('prefix'), cTodo.start('state')))
            replaceTodo = (((((((((commentType + storedTask.state) + 'todo ') + cId) + ' (') + ', '.join(storedTask.tagsA)) + ') +') + str(storedTask.lvl)) + ': ') + storedTask.comment)
            self.view.replace(_edit, sublime.Region((cTodo.end('comment') + 1), (cTodo.end('comment') + 1)), (replaceTodo + '\n'))
            self.view.replace(_edit, sublime.Region(cTodo.end('state'), cTodo.start('id')), '     ')

dataset/ETHPy150Open NikolayRag/typeTodo/commands_maintain.py TypetodoRevivifyCommand.run/VarMisuse@160/219 `cId`->`commentType`