         # reading and parsing cwl files
         lines = fs.readFileSync(f, 'utf8').split('\n')
         for line in lines
-          console.log line
           l = line.trim()
 
           # ignore comment and blank lines
           if not l.startsWith('#') and l.length != 0
             parse_result = @_parseCwlSnippets l
             if parse_result?
-              @completions.push [parse_result[1...], cwl, true]
+              @completions.push [parse_result.slice(1), cwl, true]
             else
-              @completions.push [l[1...], cwl, false]
+              @completions.push [l.slice(1), cwl, false]
 
       catch error
         # if reading errors

  filterSuggestions: true

  getSuggestions: ({editor, bufferPosition, scopeDescriptor}) ->
    prefix = @getPrefix(editor, bufferPosition)

    if not prefix.startsWith('\\')
      return []

    if atom.config.get('latextools.commandCompletion') == 'prefixed' and /[\\]{2,}/g.exec(prefix)?
      return []

    prefix = prefix.replace /[\\]+/, '\\'
    prefix = prefix[1...]

    suggestions = []
    for x in @completions
      suggestion =
        rightLabel: x[1]

      if x[2]
        suggestion.snippet = x[0]
      else
        suggestion.text = x[0]
      suggestions.push suggestion

    suggestions

  getPrefix: (editor, bufferPosition) ->
    prefix = /^\w*[\\]+/
    line = editor.getTextInRange([[bufferPosition.row, 0], bufferPosition]).split('').reverse().join('')
    line.match(prefix)?[0].split('').reverse().join('') or ''

  loadCompletions: ->
    console.log "load cwl completions files"
    @completions = []

    # get cwl_list from config
    cwl_list = atom.config.get('latextools.cwlList')

      replace_index = 0
      parsing_result = cwl_string.replace regex_braces, (m, p1, p2, p3) ->
        replace_index += 1
        g = if p1? then p1 else if p2? then p2 else if p3? then p3
        if g.length != 0
          return m.replace g, "$$\{#{replace_index}:#{g}\}"

      parsing_result = "#{parsing_result}$0"

    parsing_result
