         @setDocumentationContent()
 
     setDocumentationContent: ->
-        return unless suggestionsArr.length
-        @documentationView.setTitle(suggestionsArr[@currentSuggestionIndex][0], suggestionsArr[@currentSuggestionIndex][1])
-        @documentationView.setContent(suggestionsArr[@currentSuggestionIndex][2])
+        return unless @suggestionsArr.length
+        @documentationView.setTitle(@suggestionsArr[@currentSuggestionIndex][0], @suggestionsArr[@currentSuggestionIndex][1])
+        @documentationView.setContent(@suggestionsArr[@currentSuggestionIndex][2])
         @documentationView.show()
 
     cancelAutocompletion: ->
-        suggestionsArr = []
+        @suggestionsArr = []
         @documentationView.hide()
         return unless @autocompleteManager
         @autocompleteManager.cancel()
 
     getMaxIndex: ->
-        Math.min(maxItems, suggestionsArr.length)
+        Math.min(maxItems, @suggestionsArr.length)
 
     update: ->
         @client.update(@_editor.getURI(), @_editor.getText())

            _.throttle @update(@_editor), 300
            _.throttle @callPreBuildSuggestions(), 100
        @_disposables.push atom.config.observe('autocomplete-plus.maxSuggestions', => maxItems = atom.config.get('autocomplete-plus.maxSuggestions'))
        @_disposables.push atom.workspace.onDidChangeActivePaneItem =>
            @cancelAutocompletion()
        @_disposables.push @autocompleteManager.emitter.on 'do-select-next', =>


    preBuildSuggestions: ->
        return unless @autocompleteManager
        @suggestionsArr = []
        @checkCompletion().then (data) =>
            if !data?.length
                @cancelAutocompletion()
                return
            prefix = @getPrefix()
            if data.length is 1 and prefix is data[0].name
                @cancelAutocompletion()
