 
 ;;; Code:
 
+(require 'anaphora)
 (require 'deferred)
 (require 'hmac-def)
 (require 'hmac-md5) ; provides encode-hex-string
 (require 'json)
 (require 'request)
 (require 'request-deferred)
-
-;; Public: Things users might need to use.
 
 (defgroup ycmd nil
   "a ycmd emacs client"

        (pop-to-buffer "*ycmd-file-ready*")
        (erase-buffer)
        (insert (pp-to-string content))))))

;; Private: Stuff users should probably not touch.

(defvar ycmd--server-actual-port 0
  "The actual port being used by the ycmd server. This is set

       (_ . text)
       (_ . ranges))
      r
    (awhen (find-buffer-visiting filepath)
      (with-current-buffer it
        (let ((start-pos (ycmd--col-line-to-position
                          start-column-num
                          start-line-num))
              (end-pos (ycmd--col-line-to-position
                        end-column-num
                        end-line-num))
              (face (assoc-default kind ycmd--file-ready-faces)))
          (with-silent-modifications
            (set-text-properties
             start-pos end-pos `(font-lock-face ,face))))))))

(defun ycmd--decorate-with-parse-results (results)
  "Decorates a buffer using the results of a file-ready parse
list."
  (with-silent-modifications
    (set-text-properties (point-min) (point-max) nil))
  (mapcar 'ycmd--decorate-single-parse-result results)
  results)

(defun ycmd-notify-file-ready-to-parse ()
  (when (ycmd--major-mode-to-file-types major-mode)
