简体   繁体   English

在emacs上使用Hlint和intero

[英]Using Hlint with intero on emacs

I can't get hlint suggestions to appear in emacs using intero. 我无法使用intero在emacs中显示hlint建议。

  • I have a new installation of emacs 24.5 我有一个新的emacs 24.5安装
  • I added the intero stuff at here into new ~/.emacs file 我在这里将intero内容添加到新的~/.emacs文件中
  • I've done nothing else to emacs. 我没有为emacs做任何其他事情。

I've read that the solution is: 我读过解决方案是:

(flycheck-add-next-checker 'intero
                           '(warning . haskell-hlint))

But I don't know what I'm supposed to do with this. 但我不知道我应该怎么做。 If I add it to my ~/.emacs file then emacs fails on start up. 如果我将它添加到我的~/.emacs文件中,那么emacs会在启动时失败。

(The rest seems OK - intero starts when I open a Haskell file - errors are immediately flagged as I type.) (其余的似乎没问题 - 当我打开一个Haskell文件时,intero会启动 - 错误会在我输入时立即被标记。)

How do I get Hlint suggestions to appear? 如何获得Hlint建议?

Fixed by adding this to my ~/.emacs file: 通过将此添加到我的〜/ .emacs文件来修复:

;; do linting on-the-fly 
(with-eval-after-load 'intero
  (flycheck-add-next-checker 'intero '(warning . haskell-hlint))
)

(The full ~/.emacs file can be viewed here ) (可在此处查看完整的〜/ .emacs文件)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM