| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
We didn't look for instance docs in all the interfaces of the package. This had
the effect of instance docs not always showing up under a declaration. I took
the opportunity to clean up the code in H.I.AttachInstances a bit as well. More
cleanup is needed, however.
|
|
|
|
| |
Silly, but nice with some consistency :-)
|
| |
|
| |
|
|
|
|
| |
It's not used.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
| |
..on top of the lexParseRn work.
This patch doesn't change the InstalledInterface format, and thus,
it does not work cross-package, but that will be easy to add
subsequently.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
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)?)
|
|
|
|
|
|
|
|
| |
It changed an instance from showing ((,) a b) to (a, b)
because my synify code is more sophisticated; I hope the latter
is a good thing rather than a bad thing aesthetically, here.
But this definitely reduces code duplication!
|
| |
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We were not getting docs for re-exported class methods. This was because we
were looking up the docs in a map made from the declarations in the current
module being rendered. Obviously, re-exported class methods come from another
module.
Class methods and ATs were the only thing we were looking up using the doc map,
everything else we found in the ExporItems. So now I've put subordinate docs
in the ExportItem's directly, to make things a bit more consistent.
To do this, I added subordinates to the the declarations in the declaration
map. This was easy since we were computing subordinates anyway, to store
stand-alone in the map. I added a new type synonym 'DeclInfo', which is what we
call what is now stored in the map.
This little refactoring removes duplicate code to retrieve subordinates and
documentation from the HsGroup.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
We want to be able to render instances as separate declarations. So we remove
the Name argument of ExportDecl, since instances are nameless.
This patch also contains the first steps needed to gather type family instances
and display them in the backend, but the implementation is far from complete.
Because of this, we don't actually show the instances yet.
|
|
|
|
|
|
|
| |
We were filtering out all instances for types with unknown names. This was probably an
attempt to filter out instances for internal types. I am removing the filtering for the
moment, and will try to fix this properly later.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
| |
|
| |
|
|
|