aboutsummaryrefslogtreecommitdiff
path: root/haddock-api/src/Haddock/Interface
Commit message (Collapse)AuthorAgeFilesLines
...
| * Merge remote-tracking branch 'harpocrates/fix/missing-orphan-instances' into ↵Ben Gamari2018-01-261-1/+1
| |\ | | | | | | | | | ghc-head
| | * Pass to GHC visible modules for instance filteringAlec Theriault2018-01-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | The GHC-side `getNameToInstancesIndex` filters out incorrectly some instances because it is not aware of what modules are visible. On the Haddock side, we need to pass in the modules we are processing. On the GHC side, we need to check against _those_ modules when checking if an instance is visible.
| * | Fix duplicate declarations and TypeFamilies specificsalexbiehl2018-01-201-17/+29
| | |
| * | extractDecl: Extract associated types correctly (#736)Alexander Biehl2018-01-191-11/+21
| | |
| * | Constructor and pattern synonym argument docs (#709)Alec Theriault2018-01-131-14/+29
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Support Haddocks on constructor arguments This is in conjunction with https://phabricator.haskell.org/D4094. Adds support for rendering Haddock's on (non-record) constructor arguments, both for regular and GADT constructors. * Support haddocks on pattern synonym arguments It appears that GHC already parsed these - we just weren't using them. In the process of doing this, I tried to deduplicate some code around handling patterns. * Update the markup guide Add some information about the new support for commenting constructor arguments, and mention pattern synonyms and GADT-style constructors. * Overhaul LaTeX support for data/pattern decls This includes at least * fixing several bugs that resulted in invalid LaTeX * fixing GADT data declaration headers * overhaul handling of record fields * overhaul handling of GADT constructors * overhaul handling of bundled patterns * add support for constructor argument docs * Support GADT record constructors This means changes what existing HTML docs look like. As for LaTeX, looks like GADT records were never even supported. Now they are. * Clean up code/comments Made code/comments consistent between the LaTeX and XHTML backend when possible. * Update changelog * Patch post-rebase regressions * Another post-rebase change We want return values to be documentable on record GADT constructors.
| * Track changes to follow Trac #14529Simon Peyton Jones2017-12-072-28/+34
| | | | | | | | This tracks the refactoring of HsDecl.ConDecl.
* | @since includes package name (#749)Alec Theriault2018-03-273-30/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Metadoc stores a package name This means that '@since' annotations can be package aware. * Get the package name the right way This should extract the package name for `@since` annotations the right way. I had to move `modulePackageInfo` around to do this and, in the process, I took the liberty to update it. Since it appears that finding the package name is something that can fail, I added a warning for this case. * Silence warnings * Hide package for local 'since' annotations As discussed, this is still the usual case (and we should avoid being noisy for it). Although this commit is large, it is basically only about threading a 'Maybe Package' from 'Haddock.render' all the way to 'Haddock.Backends.Xhtml.DocMarkup.renderMeta'. * Bump binary interface version * Add a '--since-qual' option This controls when to qualify since annotations with the package they come from. The default is always, but I've left an 'external' variant where only those annotations coming from outside of the current package are qualified. * Make ParserSpec work * Make Fixtures work * Use package name even if package version is not available The @since stuff needs only the package name passed in, so it makes sense to not be forced to pass in a version too.
* | Show where instances are defined (#748)Alec Theriault2018-03-212-7/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * Indicate source module of instances Above instance, we now also display a link to the module where the instance was defined. This is sometimes helpful in figuring out what to import. * Source module for type/data families too * Remove parens * Accept tests
* | extractDecl: Extract constructor patterns from data family instances (#776)Alexander Biehl2018-03-131-13/+26
| | | | | | | | | | | | * extractDecl: Allow extraction of data family instance constructors * extractDecl: extract data family instance constructors
* | Fix file handle leak (#763) (#764)Alec Theriault2018-02-251-3/+6
| | | | | | | | Brought back some mistakenly deleted code for handling encoding and eager reading of files from e0ada1743cb722d2f82498a95b201f3ffb303137.
* | Teach the HTML backend how to render methods with multiple namesalexbiehl2018-02-191-25/+1
| |
* | Add 'show' option to complement 'hide' (#752)Alec Theriault2018-02-111-10/+11
| | | | | | | | | | | | | | | | | | | | | | | | * Add 'show' option to complement 'hide' The behaviour is for flags passed in the command line to override flags in file headers. In the command line, later flags override earlier ones. Fixes #751 and #266. * Add a '--show-all' option
* | Expand SigD in a better placealexbiehl2018-02-091-2/+2
| | | | | | | | | | | | | | | | In https://github.com/haskell/haddock/issues/287 we found that haddock-2.19.0 would miss documentation on class methods with multiples names. This patch uses expandSigDecls in a more sensible place.
* | fullModuleContents: support named docsalexbiehl2018-02-061-16/+24
| |
* | Expand SigDsalexbiehl2018-02-061-2/+26
| |
* | Rename: renameHsSpliceTy ttgalexbiehl2018-02-061-1/+1
| |
* | Don't barf on 'HsSpliceTy' (#745)Alec Theriault2018-02-061-1/+12
| | | | | | | | | | | | | | | | This handles 'HsSpliceTy's by replacing them with what they expand to. IIUC everything that is happening, 'renameHsSpliceTy' should not be able to fail for the inputs we feed it from GHC. This fixes #574.
* | Don't warn about missing '~' (#746)Alec Theriault2018-02-061-5/+14
| | | | | | | | | | | | | | This manually filters out '~' from the list of things to warn about. It truly makes no sense to warn on this since '~' has nothing it could link to - it is magical. This fixes #532.
* | Add `SPDX-License-Identifier` as alised for "license" module header tokensHerbert Valerio Riedel2018-02-051-5/+6
| | | | | | | | | | | | | | | | | | | | | | C.f. SPDX 2.1 - Appendix V https://spdx.org/spdx-specification-21-web-version#h.twlc0ztnng3b The tag should appear on its own line in the source file, generally as part of a comment. SPDX-License-Identifier: <SPDX License Expression> Cherry-picked from #743
* | Warning free compilationAlexander Biehl2018-02-012-2/+0
| |
* | Specialize: Add missing IdP annotationsAlexander Biehl2018-02-011-2/+2
| |
* | Fix infinite loop when specializing instance heads (#723)Alec Theriault2018-02-011-10/+10
| | | | | | | | | | | | | | | | | | * Fix infinite loop when specializing instance heads The bug can only be triggered from TH, hence why it went un-noticed for so long. * Add test for #679 and #710
* | Grid Tables (#718)Oleg Grenrus2018-02-011-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add table examples * Add table types and adopt simple parser Simple parser is done by Giovanni Cappellotto (@potomak) in https://github.com/haskell/haddock/pull/577 It seems to support single fine full tables, so far from full RST-grid tables, but it's good start. Table type support row- and colspans, but obviously parser is lacking. Still TODO: - Latex backend. Should we use multirow package https://ctan.org/pkg/multirow?lang=en? - Hoogle backend: ? * Implement grid-tables * Refactor table parser * Add two ill-examples * Update CHANGES.md * Basic documentation for tables * Fix documentation example
* | Use the GHC lexer for the Hyperlinker backend (#714)Alec Theriault2018-02-011-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Start changing to use GHC lexer * better cpp * Change SrcSpan to RealSrcSpan * Remove error * Try to stop too many open files * wip * wip * Revert "wip" This reverts commit b605510a195f26315e3d8ca90e6d95a6737553e1. Conflicts: haddock-api/haddock-api.cabal haddock-api/src/Haddock/Interface.hs * Remove pointless 'caching' * Use dlist rather than lists when finding vars * Use a map rather than list * Delete bogus comment * Rebase followup Things now run using the GHC lexer. There are still - stray debug statements - unnecessary changes w.r.t. master * Cleaned up differences w.r.t. current Haddock HEAD Things are looking good. quasiquotes in particular look beautiful: the TH ones (with Haskell source inside) colour/link their contents too! Haven't yet begun to check for possible performance problems. * Support CPP and top-level pragmas The support for these is hackier - but no more hacky than the existing support. * Tests pass, CPP is better recognized The tests were in some cases altered: I consider the new output to be more correct than the old one.... * Fix shrinking of source without tabs in test * Replace 'Position'/'Span' with GHC counterparts Replaces 'Position' -> 'GHC.RealSrcLoc' and 'Span' -> 'GHC.RealSrcSpan'. * Nits * Forgot entry in .cabal * Update changelog
* | Pass to GHC visible modules for instance filteringAlec Theriault2018-02-011-1/+1
| | | | | | | | | | | | | | | | | | The GHC-side `getNameToInstancesIndex` filters out incorrectly some instances because it is not aware of what modules are visible. On the Haddock side, we need to pass in the modules we are processing. On the GHC side, we need to check against _those_ modules when checking if an instance is visible.
* | Fix duplicate declarations and TypeFamilies specificsalexbiehl2018-01-201-17/+29
| |
* | extractDecl: Extract associated types correctly (#736)Alexander Biehl2018-01-191-11/+21
|/
* Revert "Match changes for Trees that Grow in GHC"Ben Gamari2017-11-213-130/+136
| | | | This reverts commit 01eeeb048acd2dd05ff6471ae148a97cf0720547.
* Revert "Match Trees That Grow"Ben Gamari2017-11-212-4/+5
| | | | This reverts commit 73a26af844ac50b8bec39de11d64452a6286b00c.
* Revert "Clean up use of PlaceHolder, to match TTG"Ben Gamari2017-11-213-34/+33
| | | | This reverts commit 134a7bb054ea730b13c8629a76232d73e3ace049.
* Clean up use of PlaceHolder, to match TTGAlan Zimmerman2017-11-143-33/+34
|
* Match Trees That GrowAlan Zimmerman2017-11-082-5/+4
|
* Match changes for Trees that Grow in GHCAlan Zimmerman2017-11-073-136/+130
|
* Always return documentation for exported subordinatesalexbiehl2017-11-021-12/+17
| | | | | | | ... event if they have no documentation (e.g. noDocForDecl) By using the information in the AvailInfo we don't need additional export checks.
* Make better use of AvailInfoalexbiehl2017-11-011-57/+72
|
* Remove excessive use of list comprehensionsalexbiehl2017-10-311-12/+7
|
* fullModuleContents traverses exports in declaration orderalexbiehl2017-10-311-6/+11
|
* Overhaul Haddock's rendering of kind signatures (#681)Ryan Scott2017-10-242-3/+7
| | | | | | | | | | | | | | | * Overhaul Haddock's rendering of kind signatures * Strip off kind signatures when specializing As an added bonus, this lets us remove an ugly hack specifically for `(->)`. Yay! * Update due to 0390e4a0f61e37bd1dcc24a36d499e92f2561b67 * @alexbiehl's suggestions * Import injectiveVarsOfBinder from GHC
* Precise Haddock: Use Avails for export resolution (#688)Alexander Biehl2017-10-083-226/+217
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Use Avails for export resolution * Support reexported modules * Factor out availExportItem * Use avails for fullModuleExports * Don't use subMap in attachInstances * lookupDocs without subMap * Completely remove subMap * Only calculate unqualified modules when explicit export list is given * Refactor * Refine comment * return * Fix * Refactoring * Split avail if declaration is not exported itself * Move avail splitting
* Revert "Don't use subMap in attachInstances"Alexander Biehl2017-10-051-3/+3
| | | | This reverts commit 3adf5bcb1a6c5326ab33dc77b4aa229a91d91ce9.
* Don't use subMap in attachInstancesAlexander Biehl2017-10-051-3/+3
|
* Account for "Remember the AvailInfo for each IE"Ben Gamari2017-09-051-1/+1
| | | | | | As of GHC commit f609374a55bdcf3b79f3a299104767aae2ffbf21 GHC retains the AvailInfo associated with each IE. @alexbiehl has a patch making proper use of this change, but this is just to keep things building.
* Update for #14131Ryan Scott2017-08-232-39/+58
|
* Revert "Drop Avails from export list"alexbiehl2017-08-221-1/+1
| | | | This reverts commit a850ba86d88a4fb9c0bd175453a2580e544e3def.
* Drop Avails from export listalexbiehl2017-08-211-1/+1
|
* Merge remote-tracking branch 'origin/master' into ghc-headalexbiehl2017-08-216-287/+501
|\
| * Refactoring: Make doc renaming monadicalexbiehl2017-08-162-95/+113
| | | | | | | | This allows us to later throw warnings if can't find an identifier
| * Provide --show-interface option to dump interfaces (#645)Alexander Biehl2017-08-061-0/+109
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * WIP: Provide --show-interface option to dump interfaces Like ghcs own --show-iface this flag dumps a binary interface file to stdout in a human (and machine) readable fashion. Currently it uses json as output format. * Fill all the jsonNull stubs * Rework Bifunctor instance of DocH, update changelog and documentation * replace changelog, bring DocMarkupH doc back * Update CHANGES.md * Update CHANGES.md * Move Control.Arrow up It would result in unused import if the Bifunctor instance is not generated.
| * Fix: Generate pattern signatures for constructors exported as patterns (#663)Tim Baumann2017-08-061-1/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Fix pretty-printing of pattern signatures Pattern synonyms can have up to two contexts, both having a different semantic meaning: The first holds the constraints required to perform the matching, the second contains the constraints provided by a successful pattern match. When the first context is empty but the second is not it is necessary to render the first, empty context. * Generate pattern synonym signatures for ctors exported as patterns This fixes #653. * Simplify extractPatternSyn It is not necessary to generate the simplest type signature since it will be simplified when pretty-printed. * Add changelog entries for PR #663 * Fix extractPatternSyn error message
| * Fix renaming after instance signature specializing (#660)Moritz Drexl2017-08-051-81/+51
| | | | | | | | | | | | | | | | | | | | * rework rename * Add regression test for Bug 613 * update tests * update changelog