同步错误 - Vim、堆栈、Haskell 开发

Synastic errors - Vim, Stack, Haskell development

我在 Vim 中编辑时使用 stack for my Haskell development and Syntastic 进行错误检查。我没有安装 haskell-platform,而是使用 stack build --install-ghc 来启动我的环境,并使用受支持的 GHCcabal 和 [=] 运行ning 17=]包。

通常,我使用 cabal sandbox 并且 syntastic 与此配合得很好。我看到当我在 Vimsyntastic 运行 中执行 let g:syntastic_debug=3 时,我看到 cabal configure 检查是否安装了项目依赖项,然后继续执行一些 hlinthdevtoolsghc-mod 魔术给我一些警告 and/or 错误消息。

现在,这是我的问题。由于我的 cabal 安装程序(从 stack 安装)不知道我安装在 .stack-work.stack 的依赖项(不确定),它会抱怨我缺少必要的包并在我的 Vim 实例中出现合成 运行s 时爆炸。

正在尝试 运行 stack exec -- cabal configure returns 出现以下错误:

Use of GHC's environment variable GHC_PACKAGE_PATH is incompatible with Cabal. use the flag --package-db to specify a package database (it can be used multiple times).

我还没有找到如何通过正确的数据库传递 --package-db 选项。那里似乎没有任何工作。

那么,问题 - 是否会成功 运行 宁 stack exec -- cabal configure,避免 GHC_PACKAGE_PATH 问题让我进入工作设置?谁能给我一些指导?

hdevtools 有效。看这里:http://seanhess.github.io/2015/08/05/practical-haskell-editors.html

我计划随着新工具的出现(比如 stack-ide)保持最新状态。

This blogpost 也给出了很好的介绍。 haskell 世界里的事情变化很快,ghc-mod 现在似乎与堆栈一起工作得很好。 post 中的设置需要 neovim。

post 中的设置对我来说工作得很好,并在当前堆栈项目中找到了所有依赖项。