| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
We can get everything we need directly from TypecheckedModule.
|
|
|
|
|
| |
Simon Hegel's patch prompted me to do some refactorings in Main,
Haddock.Documentation and Haddock.Interface.
|
| |
|
| |
|
|
|
|
|
| |
Also add a flag --no-tmp-comp-dir that can be used to get the old behaviour of
writing compilation files to GHC's output directory (default ".").
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
No link was generated for 'Addr#' in a doc comment. The reason was simply that
the identifier didn't parse. We were using parseIdentifier from the GHC API,
with a parser state built from 'defaultDynFlags'. If we pass the dynflags of
the module instead, the right options are turned on on while parsing the
identifer (in this case -XMagicHash), and the parse succeeds.
|
| |
|
|
|
|
| |
Also improved and added more doc comments.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Implementing this was a little trickier than I thought, since we need to match
up instances from the renamed syntax with instances represented by
InstEnv.Instance. This is due to the current design of Haddock, which matches
comments with declarations from the renamed syntax, while getting the list of
instances of a class/family directly using the GHC API.
- Works for class instances only (Haddock has no support for type family
instances yet)
- The comments are rendered to the right of the instance head in the HTML output
- No change to the .haddock file format
- Works for normal user-written instances only. No comments are added on
derived or TH-generated instances
|
|
|
|
| |
This fixes haddock when we don't have a native code generator
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
In particular, it works cross-package.
An intermediate patch also moved the instance-finding into
createInterface, but that move turned out not to be necessary,
so if we want to do that, it'd go in a separate patch.
(Is that possible? Or will we need GHC to have loaded all the modules
first, before we can go searching for the instances (e.g. if the
modules are recursive or something)?)
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
Add a proper Haddock module header to each module, with a more finegrained
copyright. If you feel mis-accreditted, please correct any copyright notice!
The maintainer field is set to haddock@projects.haskell.org.
Next step is to add a brief description to each module.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
When support for GHC 6.10 was added, an error handler was installed only around
the typechecking phase. This had the effect that errors thrown during
dependency chasing were caught in the top-level exception handler and not
printed with enough detail. With this patch we wrap the error handler around
all our usage of the Ghc monad.
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
We can't use HscNothing if we need to run code coming from modules inside
the processed package during typechecking, which is the case for some packages
using Template Haskell. This could be improved, to e.g. use HscInterpreted and
HscNothing where possible, instead of using HscC for all modules in the
package.
|
|
|
|
|
|
|
|
|
|
| |
We should of course not try to produce documentation for boot modules! The
reason this has worked in the past is that the output of "real" modules
overwrites the output of boot modules later in the process. However, this
causes a subtle link environment problem. So let's get rid of this stupid
behaviour.
We avoid processing boot modules, but we continue to typecheck them.
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
| |
For running Haddock on GHC this reduces memory usage by about 50 MB on
a 32 bit system. A heap profile shows total memory usage peak at
about 100 MB, but actual usage is at around 300 MB even with
compacting GC (+RTS -c).
|
| |
|
| |
|
|
|
|
|
|
| |
At the same time, we fix a bug where the list of interfaces were
processed in the wrong order, when building the links and renaming
the interfaces.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|