 fuzzaldrin = require "fuzzaldrin"
 XRegExp = require('xregexp').XRegExp
 titlecaps = require "./titlecaps"
-
+yaml = require "yaml-js"
 
 module.exports =
-class BibtexProvider
+class ReferenceProvider
   ###
   For a while, I intended to continue using XRegExp with this `wordRegex`:
 

  bibtex = []

  atom.deserializers.add(this)
  @deserialize: ({data}) -> new BibtexProvider(data)

  constructor: (state) ->
    if state and Object.keys(state).length != 0
      @bibtex = state.bibtex
      @possibleWords = state.possibleWords
    else
      @buildWordListFromFiles(atom.config.get "autocomplete-bibtex.bibtex")

    if @bibtex.length == 0
      @buildWordListFromFiles(atom.config.get "autocomplete-bibtex.bibtex")

    atom.config.onDidChange "autocomplete-bibtex.bibtex", (bibtexFiles) =>
      @buildWordListFromFiles(bibtexFiles)

    resultTemplate = atom.config.get "autocomplete-bibtex.resultTemplate"
    atom.config.observe "autocomplete-bibtex.resultTemplate", (resultTemplate) =>

      blacklist: ''
      # inclusionPriority: 1 #FIXME hack to prevent default provider in MD file
      # excludeLowerPriority: true
      providerblacklist: '' #TODO Give the user the option to configure this.
      requestHandler: (options) =>
        prefix = @prefixForCursor(options.cursor, options.buffer)

