 
 _ = 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())

    exclusive: true
    autocompletePlus: null
    client: null
    suggestionsArr = null
    _editor: null
    _buffer: null
    currentSuggestionIndex: false
