   "Clear the compilation flags cache."
   (interactive)
   (ycmd--send-request "ClearCompilationFlagCache" nil))
+
+(defun ycmd-restart-semantic-server (&optional arg)
+  "Send request to restart the semantic completion backend server.
+If ARG is non-nil and current `major-mode' is `python-mode',
+prompt for the Python binary."
+  (interactive "P")
+  (let ((subcommand "RestartServer")
+        (args (and arg (eq major-mode 'python-mode)
+                   (read-string "Python binary: "))))
+    (when (not (s-blank? args))
+      (setq subcommand (list subcommand args)))
+    (ycmd--send-request subcommand nil)))
 
 (cl-defun ycmd--fontify-code (code &optional (mode major-mode))
   "Fontify CODE."

    (define-key map "v" 'ycmd-show-debug-info)
    (define-key map "d" 'ycmd-show-documentation)
    (define-key map "C" 'ycmd-clear-compilation-flag-cache)
    (define-key map "t" 'ycmd-get-type)
    (define-key map "T" 'ycmd-get-parent)
    (define-key map "f" 'ycmd-fixit)

                      (ycmd--handle-exception result)
                      (run-hook-with-args
                       'ycmd-after-exception-hook
                       subcommand request-buffer request-point result))
                  (when success-handler
                    (funcall success-handler result)))))))))))

(defun ycmd--send-completer-command-request (subcommand &optional buffer pos)
  "Send completer SUBCOMMAND for BUFFER at POS."
  (let* ((buffer (or buffer (current-buffer)))
         (pos (or pos (point)))
         (subcommand (if (listp subcommand)
                         subcommand
                       (list subcommand)))
         (content (cons (append (list "command_arguments")
                                subcommand)
                        (ycmd--standard-content buffer pos))))
    (ycmd--request
     "/run_completer_command"
