   (setq flycheck-ycmd--cache results)
   (flycheck-buffer-automatically))
 
+(defun flycheck-ycmd--in-supported-mode ()
+  "Determines if buffer is in `ycmd-mode` and another mode supported by ycmd."
+  (and ycmd-mode
+       (-contains? (mapcar 'car ycmd--file-type-map) major-mode)))
+
 (defun flycheck-ycmd-setup ()
   "Convenience function to setup the ycmd flycheck checker.
 

(flycheck-define-generic-checker 'ycmd
  "A flycheck checker using parse results from ycmd."
  :start #'flycheck-ycmd--start
  :predicate (lambda () ycmd-mode))

(provide 'flycheck-ycmd)


;;
;;; Code:

(require 'dash)
(require 'flycheck)
(require 'ycmd)

