   unregisterEditor: (editor) ->
     provider = @getProviderForEditor(editor)
     return unless provider
+    @autocompletePlus.unregisterProvider provider
     provider.dispose()
     idx = @providers.indexOf(provider)
     @providers.splice(idx, 1)

    atom.commands.add 'atom-text-editor', 'tern:definition': (event) =>
        @findDefinition()
    atom.commands.add 'atom-text-editor', 'tern:startCompletion': (event) =>
      @providers[@currentProviderIdx].callPreBuildSuggestions(true)
    atom.commands.add 'atom-text-editor', 'tern:stop': (event) =>
      @stopServer()

class AtomTernInitializer

  disposables: []
  grammars: ['JavaScript']
  client: null
  documentationView: null
  currentProviderIdx: false
  activeTextEditor: null

  # autocomplete
