在 emacs 中确定定义了函数的模块?

Determining in emacs the module in which function is defined?

假设我有以下内容

open A
open List

let double = map (fun x -> 2*x) [1;2;3]

在带有 merlin-mode 的 emacs 中,我可以将光标放在 map 上并执行 merlin-type-enclosing 以获取 map.

的类型

是否有类似的命令(在 merlin、tuareg 或其他命令中)可以告诉我 map 是模块 List 的一部分,而不是 A

merlin-locate(通常绑定到 C-c C-l)将跳转到正确的模块。

注意:目前此功能无法可靠运行。 更新:自 merlin 2.2

起应该可以使用

在图阿雷格菜单中,您还有一个“在点显示完全合格的身份”(如果 merlin-mode 未激活,则绑定到 C-c C-l)。这使用 annot 文件,因此您的项目必须使用该选项编译(如果您使用 ocamlbuild,请在 _tags 中设置 true: annot)。