 
 (defcustom company-ycmd-modes '(c++-mode python-mode csharp-mode)
   "The list of modes for which company-ycmd will attempt completions.")
+
+(defcustom company-ycmd-insert-arguments t
+  "When non-nil, insert function arguments as a template after completion."
+  :type 'boolean)
 
 (defun company-ycmd--construct-candidate (src)
   "Converts a ycmd completion structure to a candidate string.

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

(defun company-ycmd--annotation (candidate)
  "Fetch the annotation text-property from a candidate string."
  (let ((params (get-text-property 0 'menu_text candidate))
        (type (get-text-property 0 'kind candidate))
        (extra (get-text-property 0 'extra_menu_info candidate)))
    (concat (unless (zerop (length params))
              (when (string-match "\(\\(.*\\)\)" params)
                (match-string 0 params)))
            (unless (zerop (length type))
              (format " [%s]" (downcase (substring type 0 1))))
            (unless (zerop (length extra))

  "The company-backend command handler for ycmd."
  (interactive (list 'interactive))
  (cl-case command
    (interactive     (company-begin-backend 'company-ycmd-backend))
    (prefix          (company-ycmd--prefix))
    (candidates      (company-ycmd--candidates arg))
    (meta            (company-ycmd--meta arg))
    (annotation      (company-ycmd--annotation arg))
    (match           (company-ycmd--match arg))
    (no-cache        't) ; Don't cache. It interferes with fuzzy matching.
    (post-completion (let ((params (company-ycmd--params arg)))
                       (when (and company-ycmd-insert-arguments params)
                         (insert params)
                         (company-template-c-like-templatify
                          (concat arg params)))))
    ))

(defun company-ycmd-enable-comprehensive-automatic-completion ()
