我对haskell并不熟悉,所以我对ghc-mod是如何工作的,以及cabal-install-like如何构建haskell世界的工具没有深入的理解。
但我不知怎么找到了来自github的vim插件,包括由ghc-mod提供动力的ghc-mod自动完成插件,这对我来说很有吸引力。
问题是它只在cabal-install初始化项目的项目级haskell源代码上工作,而在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当我编辑Setup.hs时,自动完成工作(它建议了前奏模块的关键字),但当我尝试编辑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并没有检测到任何符号。为什么会发生这种事?
https://stackoverflow.com/questions/33217217
复制相似问题