         (goto-line line)
         (forward-char (- col 1))
         (point)))))
+
+(defun ycmd-get-documentation (&optional arg)
+  "Get documentation for current point in buffer.
+
+If optional ARG is non-nil do not reparse buffer before getting
+the documentation."
+  (interactive "P")
+  (ycmd--send-request
+   (if arg "GetDocQuick" "GetDoc")
+   (lambda (result)
+     (-when-let (documentation (assoc-default 'detailed_info result))
+       (with-help-window (get-buffer-create " *ycmd-documentation*")
+         (with-current-buffer standard-output
+           (insert documentation)))))))
 
 (define-button-type 'ycmd--error-button
   'face '(error bold underline)

       "/run_completer_command"
       content
       :parser 'json-read))))

(defun ycmd--goto-location (location)
  "Move cursor to LOCATION.

           (ycmd--handle-extra-conf-exception results))
          (default-handler (funcall default-handler results)))))

(defun ycmd--send-request (type success-handler &optional exception-handler)
  "Send a request of TYPE to the `ycmd' server.

SUCCESS-HANDLER is called when for a successful response.  If
EXCEPTION-HANDLER is non-nil use it as default exception
handler."
  (when ycmd-mode
    (deferred:$

      (ycmd--send-completer-command-request
       type (current-buffer) (point))

      (deferred:nextc it
        (lambda (result)
          (when result
            (if (assoc-default 'exception result)
                (ycmd--handle-exception
                 result exception-handler)
              (funcall success-handler result))))))))

(defun ycmd--send-completer-command-request (type buffer pos)
  "Send Go To request of TYPE to BUFFER at POS."
  (with-current-buffer buffer
    (goto-char pos)
