     return @emitter.on('did-update-messages', callback)
 
   deleteMessages: (linter) ->
-    if @messages.has(linter)
+    if @linterResponses.has(linter)
       @updated = true
-      @messages.delete(linter)
+      @linterResponses.delete(linter)
 
   deleteEditorMessages: (editor) ->
     if @editorMessages.has(editor)

  deactivate: ->
    @shouldUpdatePublic = false
    @emitter.dispose()
    @messages.clear()
    @editorMessages.clear()

module.exports = MessageRegistry

    if @updated
      @updated = false
      publicMessages = []
      @linterResponses.forEach (messages) -> publicMessages = publicMessages.concat(messages)
      @editorMessages.forEach (linters) -> linters.forEach (messages) ->
        publicMessages = publicMessages.concat(messages)
      @publicMessages = publicMessages.sort (a, b) ->
