转到 Emacs 中的定义 - Haskell 模式

Goto Definition in Emacs - Haskell mode

我通过 Melpa package-install 安装了 Haskell Mode。但是,M - . (goto-definition) 仍然使用 emacs 内置的 findTags 函数。haskell 模式没有这个 goto 函数定义功能吗?

haskell-mode-jump-to-def 默认不绑定,but you can bind it yourself:

Using GHCi

You can bind the following to use GHCi to find definitions of things:

(define-key haskell-mode-map (kbd "M-.") 'haskell-mode-jump-to-def)

The one problem with this approach is that if your code doesn't compile, GHCi doesn't give any location info. So you need to make sure your code compiles and the modules you want to jump to are loaded byte-compiled.

或者,您可以按照同一页面稍后的建议使用标签文件或 GHCi/标签混合方法。