| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
| |
|
|
|
|
|
|
|
| |
This fixes GHC ticket 2746.
In order to also link to the exported subordinate names of a declaration, we
need to re-introduce the sub map in the .haddock files.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We store documentation for an entity in the 'InstalledInterface' of the
definition site module, and never in the same structure for a module which
re-exports the entity. So when a client of the Haddock library wants to look up
some documentation, he/she might need to access a hidden module. But we
currently don't store hidden modules in the .haddock files.
So we add the hidden modules and the Haddock options to the .haddock files.
The options will be used to filter the module list to obtain the visible
modules only, which is necessary for generating the contents and index for
installed packages.
|
| |
|
| |
|
|
|
|
| |
It was accidentally removed in the patch for GHC 6.8.2 compatibility
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This required one bigger change: 'readInterfaceFile' used to take an
optional 'Session' argument. This was used to optionally update the
name cache of an existing GHC session. This does not work with the
new GHC API, because an active session requires the function to return
a 'GhcMonad' action, but this is not possible if no session is
provided.
The solution is to use an argument of functions for reading and
updating the name cache and to make the function work for any monad
that embeds IO, so it's result type can adapt to the calling context.
While refactoring, I tried to make the code a little more
self-documenting, mostly turning comments into function names.
|
| |
|
| |
|
|
|
|
|
|
| |
We need to do this, since our .haddock format can potentially
change whenever GHC's version changes (even when only the patchlevel
changes).
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Ross Paterson reported a bug where links would point to the defining module
instead of the "best" module for an identifier (e.g Int pointing to GHC.Base
instead of Data.Int). This patch fixes this problem by refactoring the way
renamed names are represented. Instead of representing them by:
> data DocName = Link Name | NoLink Name
they are now represented as such:
> data DocName = Documented Name Module | Undocumented Name
and the the link-env looks like this:
> type LinkEnv = Map Name Module
There are several reasons for this. First of all, the bug was caused by
changing the module part of Names during the renaming process, without changing
the Unique field. This caused names to be overwritten during the loading of
.haddock files (which caches names using the NameCache of the GHC session).
So we might create new Uniques during renaming to fix this (but I'm not
sure that would be problem-free). Instead, we just keep the Name and add the
Module where the name is best documented, since it can be useful to keep
the original Name around (for e.g. source-code location info and for users of
the Haddock API).
Also, the names Link/NoLink don't really make sense, since wether to use
links or not is entirely up to the users of DocName.
In the process of following this change into H.Backends.Html I removed the
assumption that binder names are Undocumented (which was just an unnecessary
assumption, the OccName is the only thing needed to render these). This will
probably make it possible to get rid of the renamer and replace it with a
traversal from SYB or Uniplate.
Since DocName has changed, InterfaceFile has changed so this patch also
increments the file-format version. No backwards-compatibility is implemented.
|
| |
|
|
|
|
|
|
| |
Change readInterfaceFile to take a Maybe Session, to avoid having to pass -B
<ghc-libdir> to Haddock when there're no source files to process. This is nice when
computing contents/index for external packages.
|
|
|
|
|
|
|
| |
We introduce InstalledInterface capturing the part of Interface that is stored
in the interface files. We change the ppHtmlContents and ppHtmllIndex to take
this structure instead of a partial Interface. We add stuff like the doc map
and exported names to the .haddock file (via InstalledInterface).
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|