我是haskell的新手,所以我对haskell世界的ghc-mod
工作原理和类似构建工具如何在幕后移动没有深入的了解。cabal-install
但我不知何故从 github 找到了 vim haskell 插件,包括neco-ghc自动完成插件,ghc-mod
它对我来说似乎很有吸引力。
问题是它仅适用于已初始化项目的项目级 haskell 源代码,cabal-install
而在stack
-initialized 项目中根本不起作用。
我的目录结构是通过以下命令生成的:
~ $ mkdir my_project && cd my_project
~/my_project $ cabal init
~/my_project $ cabal sandbox init
产生
my_project
|-- Setup.hs
|-- cabal.sandbox.config
|-- src / Lib.hs
自动完成在我编辑时有效(它建议 Prelude 模块的关键字),Setup.hs
但在我尝试 edit 时我没有任何建议src/Lib.hs
。
我的:NecoGhcDiagnotics
命令输出
Current filetype: haskell
ghc-mod is executable: 1
omnifunc: necoghc#omnifunc
neocomplete.vim: 0
neocomplcache.vim: 2
YouCompleteMe: 0
vimproc.vim: 900
ghc-mod: 5.4.0.0
Imported modules: Prelude
Number of symbols in Prelude: 0
当我编辑src/Lib.hs
时
Current filetype: haskell
ghc-mod is executable: 1
omnifunc: necoghc#omnifunc
neocomplete.vim: 0
neocomplcache.vim: 2
YouCompleteMe: 0
vimproc.vim: 900
ghc-mod: 5.4.0.0
Imported modules: Distribution.Simple, Prelude
Number of symbols in Prelude: 235
是我编辑时命令的输出Setup.hs
。
ghc-mod
很明显,我在编辑时似乎没有检测到任何符号src/Lib.hs
..为什么会这样?