     constructor: (_editor, _buffer, client, autocompletePlus, documentationView) ->
         @autocompletePlus = autocompletePlus
         @_disposables = []
+        @suggestionsArr = []
         @client = client
         @_editor = _editor
         @_buffer = _buffer


_ = require 'underscore-plus'

suggestionsArr = []
maxItems = null

module.exports =

        @setDocumentationContent()

    setDocumentationContent: ->
        return unless @suggestionsArr.length
        @documentationView.setTitle(@suggestionsArr[@currentSuggestionIndex][0], @suggestionsArr[@currentSuggestionIndex][1])
        @documentationView.setContent(@suggestionsArr[@currentSuggestionIndex][2])
        @documentationView.show()

    cancelAutocompletion: ->
        @suggestionsArr = []
        @documentationView.hide()
        return unless @autocompleteManager
        @autocompleteManager.cancel()

    getMaxIndex: ->
        Math.min(maxItems, @suggestionsArr.length)

    update: ->
        @client.update(@_editor.getURI(), @_editor.getText())
