#2168: ghci should show haddock comments for identifier
-----------------------------+----------------------------------------------
Reporter: j.waldmann | Owner:
Type: feature request | Status: new
Priority: normal | Milestone: 6.10 branch
Component: GHCi | Version: 6.8.2
Severity: normal | Resolution:
Keywords: | Difficulty: Unknown
Testcase: | Architecture: Unknown
Os: Unknown |
-----------------------------+----------------------------------------------
Changes (by claus):
* cc: claus (added)
Comment:
the [http://www.cs.kent.ac.uk/~cr3/toolbox/haskell/Vim/ haskellmode for
vim plugins] have supported this for quite some time, but only for
installed packages, by going the awkward route of parsing the urls out of
the `doc-index-*.html` files. replacing that hack with something supported
by ghc would be nice.
haddock comments are often meant to be used from within a browser, with
interlinkage/highlighting/etc, so the plugins call a browser, and i'd
recommend ghci doing the same, separating out the need for a text/console-
renderer.
that reduces the problem to
1 finding the correct base urls, which is mostly ghc-pkg responsibility
(currently outside ghc api, i think) - `ghc --print-docdir` would give one
location; `ghc-pkg field '*' haddock-html` gives all locations (the latter
is a recent addition to `ghc-pkg` and not yet used in the haskellmode
plugins).
2 constructing the correct relative urls, which ghc api ought to provide
help with
3 finding the correct tool instance (which `ghc-pkg` is the one to call
for the current `ghci` session?). there's a ticket somewhere for this
general problem, iirc.
4 do something about sources/modules not yet processed by haddock
given solutions to 2&3, accessible from within ghci, one could then use
`ghc-pkg` to construct the complete url for an identifier, and call a
browser for it. i'd be tempted to require running haddock to avoid
treating 4 specially, but a purely cmdline-based interface might be nice,
too.
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/2168#comment:4>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs