bitc / vim-hdevtools

Vim plugin for Haskell development
132 stars 25 forks source link

hdevtools is ignoring local .ghci files #3

Open adinapoli opened 12 years ago

adinapoli commented 12 years ago

Hi,

imagine I'm contributing on a project with has a local .ghci files, i.e. a .ghci files in the project root. Suppose this project hides a package and solves an ambiguity.

If I launch vim from the aforementioned directory, and ask vim-hsdevtools for the type of a function, this is what I get:

Error loading targets src/Snap/Snaplet/Internal/Lensed.hs:10:8: Ambiguous module name `Control.Monad.CatchIO': it was found in multiple packages: MonadCatchIO-transformers-0.3.0.0 MonadCatchIO-mtl-0.3.0.5

The error would be fixed reading the proper option (i.e. hide package) from the local .gchi files, but hdevtools seems to ignore it.

I hope the issue is clear.

Cheers, A.

bitc commented 12 years ago

You can use the variable g:hdevtools_options to configure ghc options. In your case you want -hide-package

So set it to something like this:

let g:hdevtools_options = '-g-hide-package -gtransformers'

Note that there is no space between -g and the name of the package, transformers

Put that line in your project's vimrc file, or in your global vimrc file.

adinapoli commented 12 years ago

Thanks. Any chance to fix it programmatically exploiting the fact options you need are in a local .ghci file?

Cheers, A.

jamesdbrock commented 7 years ago

This hdevtools branch, if accepted, will give you the ability to put your GHC options in local .hdevtoolsrc project file. https://github.com/hdevtools/hdevtools/pull/59