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

        return suggestions

    callPreBuildSuggestions: (force) ->
        cursor = @_editor.getLastCursor()
        prefix = cursor.getCurrentWordPrefix()
        if force || /^[a-z0-9.\"\']$/i.test(prefix[prefix.length - 1])

        else
          @cancelAutocompletion()

    getPrefix: ->
        return @prefixOfSelection(@_editor.getLastSelection())

    preBuildSuggestions: ->
        return unless @autocompleteManager
        suggestionsArr = []
        @checkCompletion().then (data) =>
            return unless data?.length
            prefix = @getPrefix()
            if data.length is 1 and prefix is data[0].name
                @cancelAutocompletion()
                return
            for obj, index in data
                if index == maxItems
                    break
