| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
| |
* `unL` is already defined by GHC as `unLoc`
* `reL` is already defined by GHC as `noLoc` (in a safer way too!)
* Condense `setOutputDir` and add a about exporting from GHC
Fixes #978
|
|
|
|
|
|
|
|
|
|
|
| |
None of these error cases should ever have been reachable, so this is
just a matter of leveraging the type system to assert this.
* Use the `NoExtCon` and `noExtCon` to handle case matches for no
extension constructors, instead of throwing an `error`.
* Use the extension field of `HsSpliceTy` to ensure that this variant
of `HsType` cannot exist in an `HsType DocNameI`.
|
|
|
|
|
|
|
| |
* removed functions in `Haddock.Utils` that were not used anywhere
(or exported from the `haddock-api` package)
* moved GHC-specific utils from `Haddock.Utils` to `Haddock.GhcUtils`
|
|
|
|
|
| |
Adjusted changelogs and versions in `.cabal` files in preparation for
the upcoming release bundled with GHC 8.10.
|
|
|
|
|
|
| |
* unused imports
* imports of `Data.List` without import lists
* missing `CompatPrelude` file in `.cabal`
|
|\ |
|
| | |
|
| |
| |
| |
| |
| |
| | |
It is possible to fail to extract an HIE ast. This is however not a
reason to produce _no_ output - we should still make a colorized HTML
page.
|
| | |
|
| | |
|
| |
| |
| |
| | |
(cherry picked from commit 3ee6526d4ae7bf4deb7cd1caf24b3d7355573576)
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Before LLVM 6.0.1 (or 10.0 on Apple LLVM), there was a bug where
lines that started with an octothorpe but turned out not
to lex like pragmas would have an extra line added after them.
Since this bug has been fixed upstream and that it doesn't have dire
consequences anyways, the workaround is not really worth it
anymore - we can just tell people to update their clang version (or re-structure
their pragma code).
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
After this commit, we can run with `--latex` on all boot libraries
without crashing (although the generated LaTeX still fails to compile in
a handful of larger packages like `ghc` and `base`).
* Add newlines after all block elements in LaTeX. This is important to
prevent the final output from being more an more indented. See the
`latext-test/src/Example` test case for a sample of this.
* Support associated types in class declarations (but not yet defaults)
* Several small issues for producing compiling LaTeX;
- avoid empy `\haddockbeginargs` lists (ex: `type family Any`)
- properly escape identifiers depending on context (ex: `Int#`)
- add `vbox` around `itemize`/`enumerate` (so they can be in tables)
* Several spacing fixes:
- limit the width of `Pretty`-arranged monospaced code
- cut out extra space characters in export lists
- only escape spaces if there are _multiple_ spaces
- allow type signatures to be multiline (even without docs)
* Remove uninteresting and repetitive `main.tex`/`haddock.sty` files
from `latex-test` test reference output.
Fixes #935, #929 (LaTeX docs for `text` build & compile)
Fixes #727, #930 (I think both are really about type families...)
|
| |
| |
| |
| |
| |
| |
| |
| | |
`markupWarning` often processes inputs which span across paragraphs.
Unfortunately, LaTeX's `emph` is not made to handle this (and will
crash).
Fixes #936.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
* default methods now get rendered differently
* default associated types get rendered
* fix a forgotten `s/TypeSig/ClassOpSig/` refactor in LaTeX backend
* LaTeX backend now renders default method signatures
NB: there is still no way to document default class members and the
NB: LaTeX backend still crashes on associated types
|
| |\ |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The information about whether or not there is a source-level `forall`
is already available on a `ConDecl` (as `con_forall`), so we should use
it instead of always assuming `False`!
Fixes #1002.
|
| | |
| | |
| | | |
Fixes #992
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
* don't forget to print explicit `forall`'s when there are arg docs
* when printing an explicit `forall`, print all tyvars
Fixes #973
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
* '(<|>)' and '`elem`' now get parsed and rendered properly as links
* 'DbModule'/'DbUnitId' now properly get split apart into two links
* tuple names now get parsed properly
* some more small niceties...
The identifier parsing code is more precise and more efficient (although to be
fair: it is also longer and in its own module). On the rendering side, we need
to pipe through information about backticks/parens/neither all the way through
from renaming to the backends.
In terms of impact: a total of 35 modules in the entirety of the bootlib + ghc
lib docs change. The only "regression" is things like '\0'. These should be
changed to @\\0@ (the path by which this previously worked seems accidental).
|
| | | |
|
| | |
| | |
| | | |
This is needed to compile `haddock` when [GHC Proposal #229](https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0229-whitespace-bang-patterns.rst) is implemented.
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
`FunTy` now has an `AnonArgFlag` that indicates whether the arrow is
a `t1 => t2` or `t1 -> t2`.
This commit shouldn't change any functionality in Haddock.
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Before LLVM 6.0.1 (or 10.0 on Apple LLVM), there was a bug where
lines that started with an octothorpe but turned out not
to lex like pragmas would have an extra line added after them.
Since this bug has been fixed upstream and that it doesn't have dire
consequences anyways, the workaround is not really worth it
anymore - we can just tell people to update their clang version (or re-structure
their pragma code).
|
|/ / |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Now that Haddock is moving towards working entirely over `.hi` and `.hie` files,
all declarations and types are going to be synthesized via the `Convert` module.
In preparation for this change, here are a bunch of fixes to this module:
* Add kind annotations to type variables in `forall`'s whose kind is not `Type`,
unless the kind can be inferred from some later use of the variable. See
`implicitForAll` and `noKindTyVars` in particular if you wish to dive into this.
* Properly detect `HsQualTy` in `synifyType`. This is done by following suit with
what GHC's `toIfaceTypeX` does and checking the first argument of
`FunTy{} :: Type` to see if it classified as a given/wanted in the typechecker
(see `isPredTy`).
* Beef up the logic around figuring out when an explicit `forall` is needed. This
includes: observing if any of the type variables will need kind signatures, if the
inferred type variable order _without_ a forall will still match the one GHC
claims, and some other small things.
* Add some (not yet used) functionality for default levity polymorphic type
signatures. This functionality similar to `fprint-explicit-runtime-reps`.
Couple other smaller fixes only worth mentioning:
* Show the family result signature only when it isn't `Type`
* Fix rendering of implicit parameters in the LaTeX and Hoogle backends
* Better handling of the return kind of polykinded H98 data declarations
* Class decls produced by `tyThingToLHsDecl` now contain associated type
defaults and default method signatures when appropriate
* Filter out more `forall`'s in pattern synonyms
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
# Summary
This is a large architectural change to the Hyperlinker.
* extract link (and now also type) information from `.hie` instead
of doing ad-hoc SYB traversals of the `RenamedSource`. Also
adds a superb type-on-hover feature (#715).
* re-engineer the lexer to avoid needless string conversions. By going
directly through GHC's `P` monad and taking bytestring slices, we
avoid a ton of allocation and have better handling of position
pragmas and CPP.
In terms of performance, the Haddock side of things has gotten _much_
more efficient. Unfortunately, much of this is cancelled out by the
increased GHC workload for generating `.hie` files. For the full set of
boot libs (including `ghc`-the-library)
* the sum of total time went down by 9-10% overall
* the sum of total allocations went down by 6-7%
# Motivation
Haddock is moving towards working entirely over `.hi` and `.hie` files.
This change means we no longer need the `RenamedSource` from
`TypecheckedModule` (something which is _not_ in `.hi` files).
# Details
Along the way a bunch of things were fixed:
* Cross package (and other) links are now more reliable (#496)
* The lexer tries to recover from errors on every line (instead of at CPP
boundaries)
* `LINE`/`COLUMN` pragmas are taken into account
* filter out zero length tokens before rendering
* avoid recomputing the `ModuleName`-based `SrcMap`
* remove the last use of `Documentation.Haddock.Utf8` (see #998)
* restructure temporary folder logic for `.hi`/`.hie` model
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| | |
* Synify and render properly promoted type variables
Fixes #923.
* Accept output
|
| |
| |
| |
| |
| |
| |
| | |
This commit should not introduce any change in functionality!
* consistently use `getOccString` to convert `Name`s to strings
* compare names directly when possible (instead of comparing strings)
* get rid of unused utility functions
|
| |
| |
| |
| |
| |
| |
| | |
* remove redundant imports (only brought to light due to recent work for
improving redundant import detection)
* fix a bug that was casuing exports to appear in reverse order
* fix something in haddock-library that prevented compilation on old GHC's
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Trac Issues #15495
This patch removes the ping-pong style from HsPat (only, for now), using the plan laid out at https://ghc.haskell.org/trac/ghc/wiki/ImplementingTreesThatGrow/HandlingSourceLocations (solution A).
- the class `HasSrcSpan`, and its functions (e.g., `cL` and `dL`), are introduced
- some instances of `HasSrcSpan` are introduced
- some constructors `L` are replaced with `cL`
- some patterns `L` are replaced with `dL->L` view pattern
- some type annotation are necessarily updated (e.g., `Pat p` --> `Pat (GhcPass p)`)
|
| |
| |
| |
| | |
It got introduced in ghc/ghc@ae2c9b40f5b6bf272251d1f4107c60003f541b62.
|
|\| |
|
| |\ |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Correspondingly, we wrap all inline/diplay math in
<span class="mathjax"> ... the math .... </span>
This fixes #959.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
* Fix misplaced Haddocks in Haddock itself
Haddock should be able to generate documentation for 'haddock-api'
again.
* Make CI check that documentation can be built.
* Add back a doc that is OK
|
| | | |
|
| | |
| | |
| | |
| | |
| | | |
In the unfortunate event that the "Contents" summary doesn't fit
vertically (like in the "Prelude"), it will be scrollable.
|
| | |
| | |
| | |
| | |
| | |
| | | |
* swap the minimize unicode to something more intuitive
* use new unicode expander/collapser for instance lists
* address some alignment issues in the "index" page
|
| |\| |
|
| | |
| | |
| | |
| | |
| | | |
This fixes #953 by passing more names into the generated ids.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The current html generator of this branch wraps the package-header
caption as a div, which does not work (without style adjustments) with
the old themes. Changing it from div to span does the trick, without
needing to adjust the old stylesheets.
|
| | | |
|