Spacemacs 外部库的代码完成

Code completion for external libraries for Spacemacs

在带有 Cursive 插件的 IntelliJ 中,我们有 code completion

helps you complete the names of classes, methods, fields, and keywords within the visibility scope. When you invoke code completion, IntelliJ IDEA analyses the context and suggests the choices that are reachable from the current position of the caret.

当一个项目被索引时,这也会在导入的库中找到方法:

这里我们在输入reagent/后弹出reagent.core中可用的所有方法。

我希望在具有 Clojure 模式的 Spacemacs 中具有相同的行为。我得到的只是同一文件中已经定义的名称:

我尝试通过按 <SPC> p G 生成带有 ctags 的 TAGS 文件。但这似乎不等同于 IntelliJ 的索引,因为它显示了其他补全,如下所示:

是否可以像 IntelliJ Cursive 一样在 Spacemacs Clojure 中显示导入库的补全?如果是这样,怎么做?

Spacemacs 中的 Clojure 支持是通过添加 clojure 层来配置的。

编辑 ./spacemacs 并将 clojure 添加到`dotspacemacs-configuration-layers 函数中定义的层列表

重启Emacs会自动下载Clojure的相关包。