           ;;       You need DeriveFunctor to derive an instance for this class
           ;;       Try GeneralizedNewtypeDeriving for GHC's newtype-deriving extension
           ;;       In the newtype declaration for ‘X’
-          (while (string-match extension-regex text start)
-            (setq note t)
-            (add-to-list 'intero-suggestions
-                         (list :type 'add-extension
-                               :extension (match-string 0 text)))
-            (setq start (min (length text) (1+ (match-end 0)))))
+          (let ((start 0))
+            (while (string-match extension-regex text start)
+              (setq note t)
+              (add-to-list 'intero-suggestions
+                           (list :type 'add-extension
+                                 :extension (match-string 0 text)))
+              (setq start (min (length text) (1+ (match-end 0))))))
           ;; Messages of this format:
           ;;
           ;; The import of ‘Control.Monad’ is redundant

This may update in-place the MSGS objects to hint that
suggestions are available."
  (setq intero-suggestions nil)
  (let ((extension-regex (regexp-opt (intero-extensions))))
    (cl-loop
     for msg in msgs
     do (let ((start 0)
              (text (flycheck-error-message msg))
              (note nil))
          ;; Messages of this format:
          ;;

  (with-current-buffer (intero-buffer 'backend)
    (or intero-ghc-version
        (setq intero-ghc-version
              (with-temp-buffer
                (cl-case (save-excursion
                           (call-process "stack" nil (current-buffer) t "ghc" "--" "--numeric-version"))
                  (0
                   (buffer-substring (line-beginning-position) (line-end-position)))
                  (1 nil)))))))

(defun intero-get-targets ()
  "Get all available targets."
