         (company-template-c-like-templatify
          (concat arg params))))))
 
+(defun company-ycmd--doc-buffer (candidate)
+  "Return buffer with docstring for CANDIDATE if it is available."
+  (let* ((extra-data (get-text-property 0 'extra_data candidate))
+         (doc (cdr (assoc 'doc_string extra-data))))
+    (when (s-present? doc)
+      (company-doc-buffer doc))))
+
 (defun company-ycmd (command &optional arg &rest ignored)
   "The company-backend command handler for ycmd."
   (interactive (list 'interactive))

    (annotation      (company-ycmd--annotation arg))
    (no-cache        company-ycmd-enable-fuzzy-matching)
    (sorted          't)
    (post-completion (company-ycmd--post-completion arg))))

;;;###autoload
(defun company-ycmd-setup ()

  :group 'ycmd)

(defconst company-ycmd-completion-properties
  '(kind extra_menu_info detailed_info menu_text extra_data)
  "Fields from ycmd completions structures that we attach as text
  properties to company completion strings.")

