 
 (defun company-ycmd-enable-comprehensive-automatic-completion ()
   "This updates company-begin-commands so that automatic
-completion will occur after typing :: and ->. By default
-company-mode will not start automatic completion after : and >
-characters, so you need to call this if you want full automatic
-completion for C/C++."
+completion will occur after typing :: and ->. 
+
+By default company-mode will not start automatic completion
+after : and > characters, so you need to call this if you want
+full automatic completion for C/C++."
   (interactive)
   (mapcar
    (lambda (x)

           (company-grab-symbol-cons "\\.\\|->\\|::" 2))))

(defun company-ycmd-get-candidates (prefix)
  (cons :async
        (lambda (cb) (funcall cb (company-ycmd-candidates)))))

(defun company-ycmd-backend (command &optional arg &rest ignored)
  (interactive (list 'interactive))
  (case command
    (interactive (company-begin-backend 'company-ycmd-backend))

    nil))

(defun company-ycmd-get-metadata (candidate)
  "Fetch the metadata text-property from a candidate string."
  (get-text-property 0 'detailed_info candidate))

(defun company-ycmd-get-annotation (candidate)
  "Fetch the annotation text-property from a candidate string."
  (format " [%s]" (get-text-property 0 'kind candidate)))

(defun company-ycmd-get-prefix ()
  "Prefix-command handler for the company backend."
  (and (memq major-mode company-ycmd-modes)
       buffer-file-name
       (ycmd-running?)
