jyp / attrap

ATtempt To Repair At Point (emacs flycheck extension)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Attrap: ATtempt To Repair At Point

This is an Emacs minor mode which automates the application of hints in messages reported through flymake or flycheck.

https://melpa.org/packages/attrap-badge.svg https://stable.melpa.org/packages/attrap-badge.svg

Attrap! provides a single entry point to attempt to fix the error at point. Invoke the command attrap-attrap when point is on a flymake or flycheck error, and check the results. Attrap! currently comes with fixers for emacs-lisp, ~dante~ and hlint. Support for other checkers can be added dynamically (See M-x customize-group attrap for the documentation).

Installation with use-package:

(use-package attrap
  :ensure t
  :bind (("C-x /" . attrap-attrap))) ;; use any binding of your choice

Configuration of the hlint checker

Attrap requires a flymake checker for hlint. It should be setup by adding the appropriate hook to the haskell mode:

(add-hook 'haskell-mode-hook
          (defun my/haskell-hook ()
            (require 'attrap)
            (require 'flymake-flycheck)
            (flymake-mode)
            (add-hook 'flymake-diagnostic-functions 'attrap-flymake-hlint nil t)))

Unfortunately there is no direct support for flycheck at the moment.

Note for GHC users

Attrap assumes that GHC outputs unicode symbols in error messages, which will happen only if $LANG is set to a proper value, such as

export LANG=en_US.UTF-8 

About

ATtempt To Repair At Point (emacs flycheck extension)

License:GNU General Public License v3.0


Languages

Language:Emacs Lisp 100.0%