          (point-min) (point-max) nil))
       (buffer-string))))
 
-(defun ycmd--handle-get-parent-or-type-success (result)
-  "Handle a successful GetParent or GetType response for RESULT."
-  (--when-let (cdr (assq 'message result))
+(defun ycmd--handle-get-parent-or-type-success (response)
+  "Handle a successful GetParent or GetType RESPONSE."
+  (--when-let (cdr (assq 'message response))
     (message "%s" (pcase it
                     ((or `"Unknown semantic parent"
                          `"Unknown type"

   (if arg "GetDocQuick" "GetDoc")
   'ycmd--handle-get-doc-success))

(defun ycmd--handle-get-doc-success (result)
  "Handle successful GetDoc response for RESULT."
  (let ((documentation (cdr (assq 'detailed_info result))))
    (if (not (s-blank? documentation))
        (with-help-window (get-buffer-create " *ycmd-documentation*")
          (with-current-buffer standard-output

       (ycmd-view-mode)
       buf)))

(defun ycmd--view (response mode)
  "Select `ycmd-view-mode' buffer and display items from RESPONSE.
MODE is a major mode for fontifaction."
  (let ((view-buffer
         (ycmd--with-view-buffer
          (->>
           (--group-by (cdr (assq 'filepath it)) response)
           (mapc (lambda (it) (ycmd--view-insert-location it mode)))))))
    (pop-to-buffer view-buffer)
    (setq next-error-last-buffer view-buffer)))
