<commit_before>{SelectListView,$$} = require 'atom'

module.exports =

class TaskListView extends SelectListView
  initialize: ->
    super
    @addClass('overlay from-top task-list')
    return atom.workspaceView.command 'task-list:toggle', =>
      return @.toggle()

  attach: ->
    editor = atom.workspaceView.getActivePaneItem()
    if editor
      ebuffer = editor.buffer
      if ebuffer
        matcher = /TODO: (.*)|FIXME: (.*)/g
        todoFinder = /TODO: (.*)/
        fixmeFinder = /FIXME: (.*)/
        todos = []
        if ebuffer.cachedText
          if ebuffer.cachedText.match(matcher)
            for match in ebuffer.cachedText.match(matcher)
              if todoFinder.exec(match)
                todos.push({message: todoFinder.exec(match)[1], type: 'TODO'})
              else
                todos.push({message: fixmeFinder.exec(match)[1], type: 'FIXME'})
            @setItems(todos)
          else
            @setItems([{message: 'No Tasks Found' , type: ''}])
        else
          @setItems([{message: 'No Tasks Found' , type: ''}])
        atom.workspaceView.append(this)
        @focusFilterEditor()
  viewForItem: (item) ->
    if item.type == 'TODO'
      markerClass = 'task-status status text-success'<commit_msg>Change regex<commit_after>{SelectListView,$$} = require 'atom'

module.exports =

class TaskListView extends SelectListView
  initialize: ->
    super
    @addClass('overlay from-top task-list')
    return atom.workspaceView.command 'task-list:toggle', =>
      return @.toggle()

  attach: ->
    editor = atom.workspaceView.getActivePaneItem()
    if editor
      ebuffer = editor.buffer
      if ebuffer
        matcher = /TODO ?: (.*)|FIXME ?: (.*)/g
        todoFinder = /TODO ?: (.*)/
        fixmeFinder = /FIXME ?: (.*)/
        todos = []
        if ebuffer.cachedText
          if ebuffer.cachedText.match(matcher)
            for match in ebuffer.cachedText.match(matcher)
              if todoFinder.exec(match)
                todos.push({message: todoFinder.exec(match)[1], type: 'TODO'})
              else
                todos.push({message: fixmeFinder.exec(match)[1], type: 'FIXME'})
            @setItems(todos)
          else
            @setItems([{message: 'No Tasks Found' , type: ''}])
        else
          @setItems([{message: 'No Tasks Found' , type: ''}])
        atom.workspaceView.append(this)
        @focusFilterEditor()
  viewForItem: (item) ->
    if item.type == 'TODO'
      markerClass = 'task-status status text-success'
{'fraction_non_alphanumeric': 0.1400716275368086, 'fraction_numerical': 0.0015917230401910067, 'mean_word_length': 2.248062015503876, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2851684', 'n_tokens_mistral': 778, 'n_tokens_neox': 779, 'n_words': 158}