     @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

      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
    for item in items
      suggestions.push
        text: item

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

  getRefItems: (tex) ->
    if !fs.existsSync(tex)
      return []
    content = fs.readFileSync tex, 'utf-8'
    return @getItems(content)
