ivan-m / haskell-docs

Get the Haskell documentation of a name from a module
BSD 3-Clause "New" or "Revised" License
32 stars 8 forks source link

Simple case #20

Closed jaccokrijnen closed 9 years ago

jaccokrijnen commented 9 years ago

I'm trying to use haskell-docs on a basic use case, but it won't work. Obviously I am missing something simple (I have enabled the documentation flag in my .cabal file).

➜  ~  cabal install tagsoup
Resolving dependencies...
Configuring tagsoup-0.13.3...
Building tagsoup-0.13.3...
Installed tagsoup-0.13.3
Updating documentation index /home/jacco/.cabal/share/doc/index.html
➜  ~  haskell-docs Text.HTML.TagSoup parseTags
Couldn't find any packages with that module.

Any hints?

(GHC 7.8.4/haddock 2.14.3/Ubuntu 14.04)

ivan-m commented 9 years ago

Just to check: are you doing that in a sandbox?

Though in any case, it seems that that incantation wouldn't give you any results:

$haskell-docs Text.HTML.TagSoup parseTags
$haskell-docs Text.HTML.TagSoup.Parser parseTags
Package: tagsoup-0.13.3
parseTags
Parse a string to a list of tags, using an HTML 5 compliant parser.
    parseTags "<hello>my&amp;</world>" == [TagOpen "hello" [],TagText "my&",TagClose "world"]
jaccokrijnen commented 9 years ago

Thanks. No, this is not in a sandbox (although I wonder, is there sandbox support?).

Trying that module gave me different output, though:

➜  ~  haskell-docs Text.HTML.TagSoup.Parser parseTags
➜  ~  

That is, no output at all.

By the way, Text.HTML.TagSoup re-exports parseTags, so shouldn't it be able to give documentation from there as well?

ivan-m commented 9 years ago

As a complete guess, as haskell-docs uses the Haddock files, and parseTags isn't listed as being defined in Text.HTML.TagSoup.Parser in the Haddock file (just like if you click on "source" it will take you to the source for .Parser).

jaccokrijnen commented 9 years ago

I do seem to get valid output for types and functions from the modules in base (GHC 7.8.4/haddock 2.14.3/Ubuntu 14.04)

ivan-m commented 9 years ago

Which version of GHC did you use to build tagsoup?

jaccokrijnen commented 9 years ago

Also 7.8.4

ivan-m commented 9 years ago

Did you rebuild haskell-docs since upgrading GHC? (It might need to be rebuilt against the new version of Haddock).

jaccokrijnen commented 9 years ago

Yes, I did. I also tried cabal installing from the repo, but still the same issue :(

jaccokrijnen commented 9 years ago

After some experimenting, I'm fairly certain that only documentation for the global package database is shown, and not for the user database. Could this be a haddock version issue?

chrisdone commented 9 years ago

Curious. Not sure.

chrisdone commented 9 years ago

I think I may have a similar issue. Sometimes the text package doesn't yield any results.