Local Hoogle Launch

I want to run hoogle in my project. I successfully generated the hoogle database (file with the .hoo extension) from my project. But when I start the server locally, hoogle cannot find any functions or types defined in my project. It may find some of the foreplay functions, such as map , but none of the functions defined in my project. hoogle dump my-project.hoo dumps content without errors. I also moved my-project.hoo to ~/.cabal/share/x86_64-osx-ghc-7.8.4/hoogle-4.2.38/databases , where all the .hoo files are .hoo . No success. The -verbose switch also does not display any useful information. Any suggestion is appreciated.

Edit:

Thanks to the mhuesch suggestion mhuesch I was able to get the search results. Although the returned results are not related to local hackage docs. What I cannot find on the Internet is that the hoogle server is looking for a file named default.hoo in the current directory.

Edit 2:

If you, like me, have 5000+ databases (i.e. .hoo ), you may get a "too many open files" error when merging them. The trick is simple: run hoogle combine x*.hoo -o=parts/x.hoo for all x='a' ... 'z' , and then run hoogle combine *.hoo -o=default.hoo in the parts folder .

Edit 3:

If you want to associate hoogle search results with your local hacker documentation, use hoogle convert --doc='absolute-path-to-your-doc' your-package-hoogle-doc.txt default.hoo . I could not process the relative path.

+5
source share
1 answer

Hoogle searches for the current directory (where the hoogle command is hoogle ) for the database named "default.hoo", so if you rename your database to it, it should find it.

To add it to the database in your cabal directory, I believe this should work (taken from http://newartisans.com/2012/09/running-a-fully-local-hoogle/ ):

 cd {...path to hoogle databases dir...} mv default.hoo default.hoo-prev hoogle combine *.hoo 

Edit: (in response to Oxy changes)

My knowledge of default.hoo taken from here . It does not seem to be very well known.

hoobuddy (the aforementioned related project), while cool doesn't seem to address what you want. I think the key to this is to help hoogle data.

 $ hoogle data --help ... -l --local[=FILEPATH] Use local documentation if available ... 

I did not do this myself, so I'm not sure. The author of this writeup got a link to the local documentation by compiling hoogle from the source and adding its local docs directory. I think you can avoid this by using hoogle data.

+2
source

All Articles