                         that.manager.documentation.hide()
                         return
                     for obj, index in data.completions
-                        if index == maxItems
+                        if index == that.maxItems
                             break
                         obj = that.fixCompletion(obj)
 

        if !@isValidPrefix(prefix) and !@force
            @manager.documentation.hide()
            return []

        prefix = @fixPrefix(prefix)

        that = this

        new Promise (resolve) ->
            that.manager.client.update(editor.getURI(), editor.getText()).then =>
                that.manager.client.completions(editor.getURI(), {line: bufferPosition.row, ch: bufferPosition.column}).then (data) =>
                    that.clearSuggestions()

    suggestionsArr = []
    currentSuggestionIndex: 0
    disposables: []
    maxItems: 1000
    force: false
    # automcomplete-plus
    autocompletePlus: null
    selector: '.source.js'
    disableForSelector: '.source.js .comment'
    inclusionPriority: 1
    excludeLowerPriority: false

    init: (manager) ->
        @manager = manager
