     @suggestions = suggestions
     return suggestions
 
-  getRefItems: (tex) ->
+  getItems: (content) ->
     items = []
-    if !fs.existsSync(tex)
-      return items
-    content = fs.readFileSync tex, 'utf-8'
     itemReg = /(?:\\label(?:\[[^\[\]\{\}]*\])?){([^}]*)}/g
     loop
       result = itemReg.exec content

      if items.indexOf result[1] < 0
        items.push result[1]
    return items

      suggestions.sort((a, b) ->
        return a.text.indexOf(prefix) - b.text.indexOf(prefix))
      return suggestions

    if !@latex.manager.findAll()
      return suggestions

    items = []
    for tex in @latex.texFiles
      items = items.concat @getRefItems tex

    editor = atom.workspace.getActivePaneItem()
    currentPath = editor?.buffer.file?.path
    currentContent = editor?.getText()

    if currentPath and currentContent
      if (path.extname(currentPath) == '.tex')
        items = items.concat @getItems currentContent

    for item in items
      suggestions.push
        text: item
