aboutsummaryrefslogtreecommitdiff
path: root/haddock-api/src/Haddock/GhcUtils.hs
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'origin/ghc-8.10' into ghc-9.0Ben Gamari2021-01-051-24/+125
|\
| * Changes for GHC#17566Alex Biehl2020-12-081-3/+26
| | | | | | | | See https://gitlab.haskell.org/ghc/ghc/merge_requests/2469
| * Enable two warnings (#1245)tomjaguarpaw2020-12-081-0/+1
| | | | | | | | | | because they will be soon be added to -Wall. See https://gitlab.haskell.org/ghc/ghc/-/issues/15656
| * Use `unLoc`/`noLoc` from GHC instead of `unL`/`reL`Alec Theriault2020-03-281-33/+20
| | | | | | | | | | | | | | | | * `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
| * Use TTG empty extensions to remove some `error`'sAlec Theriault2020-03-281-8/+7
| | | | | | | | | | | | | | | | | | | | | | 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`.
| * Remove unused `Haddock.Utils` functionsAlec Theriault2020-03-281-0/+91
| | | | | | | | | | | | | | * 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`
| * Merge branch 'ghc-8.8' into ghc-8.10Alec Theriault2020-03-201-4/+10
| |\
| | * Fix #1063 with better parenthesization logic for contextsAlec Theriault2019-05-171-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The only other change in html/hoogle/hyperlinker output for the boot libraries that this caused is a fix to some Hoogle output for implicit params. ``` $ diff -r _build/docs/ old_docs diff -r _build/docs/html/libraries/base/base.txt old_docs/html/libraries/base/base.txt 13296c13296 < assertError :: (?callStack :: CallStack) => Bool -> a -> a --- > assertError :: ?callStack :: CallStack => Bool -> a -> a ```
| | * Merge branch 'ghc-8.6' into ghc-8.8Alec Theriault2019-03-031-1/+4
| | |\
| | | * Update the ghc-8.6 branch (#889)Simon Jakobi2018-07-201-0/+96
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Revert "Bump GHC version to 8.6" This was applied to the wrong branch; there's now a `ghc-8.6` branch; ghc-head is always supposed to point to GHC HEAD, i.e. an odd major version. The next version bump to `ghc-head` is supposed to go from e.g. 8.5 to 8.7 This reverts commit 5e3cf5d8868323079ff5494a8225b0467404a5d1. * README updates (#856) * README: Remove mentions of master branch * README: Add instructions for using html-test * README: Change command to run _all_ the testsuites * README: Add project overview section (cherry picked from commit 61d6f935da97eb96685f07bf385102c2dbc2a33c) * Export more fixities for Hoogle (#871) This exports fixities for more things, including class methods and type-level operators. (cherry picked from commit 88316b972e3d47197b1019111bae0f7f87275fce) * Avoid line breaks due to line length in Hoogle (#868) * Avoid line breaks due to line length in Hoogle Hoogle operates in a line-oriented fashion, so we should avoid ever breaking due to long lines. One way of doing this non-intrusively is to modify the 'DynFlags' that are threaded through the 'Hoogle' module (note this is anyways only passed through for use in the various 'showSDoc' functions). * Amend test case (cherry picked from commit 657b1b3d519545f8d4ca048c06210d6cbf0f0da0) * tyThingToLHsDecl: Preserve type synonyms that contain a forall (#880) * tyThingToLHsDecls: Preserve type synonyms that contain a forall Fixes #879. * Add Note [Invariant: Never expand type synonyms] * Clarify Note [Invariant: Never expand type synonyms] (cherry picked from commit c3eb3f0581f69e816f9453b1747a9f2a3ba02bb9) * Fix HEAD html-test (#860) * Update tests for 'StarIsType' * Accept tests * Revert "Update tests for 'StarIsType'" This reverts commit 7f0c01383bbba6dc5af554ee82988d2cf44e407a. * Refactor handling of parens in types (#874) * Fix type parenthesization in Hoogle backend Ported the logic in the HTML and LaTeX backends for adding in parens into something top-level in 'GhcUtil'. Calling that from the Hoogle backend fixes #873. * Remove parenthesizing logic from LaTeX and XHTML backends Now, the only times that parenthesis in types are added in any backend is through the explicit 'HsParTy' constructor. Precedence is also represented as its own datatype. * List out cases explicitly vs. catch-all * Fix printing of parens for QuantifiedConstraints The priority of printing 'forall' types was just one too high. Fixes #877. * Accept HTML output for quantified contexts test * Preserve docs on type family instances (#867) * Preserve docs on type family instances The only problem was that the instance location was slightly off for type family instances. * Accept output (cherry picked from commit 133e9c2c168db19c1135479f7ab144c4e33af2a4) * Fix broken instance source links (#869) The problem manifests itself in instances that are defined in modules other than the module where the class is defined. The fix is just to thread through the 'Module' of the instance further along. Since orphan instances appear to already have been working, I didn't do anything there. (cherry picked from commit 2de7c2acf9b1ec85b09027a8bb58bf8512e91c05) * Add some more unicode related tests (#872) This has been fixed for sure ever since we switched from attoparsec to parsec. Parts of it may have been working before that, but there was a point where this would have failed (see #191). A regression test never hurt anyone. :) (cherry picked from commit 5ec7715d418bfac0f26aec6039792a99a6e89370) * Misc tests (#858) * More tests * spliced types * constructor/pattern argument docs * strictness marks on fields with argument docs * latex test cases need seperate directory * Accept tests * Additional tests for the identifier parser (#816) * Add tests for the identifier parser * docs: Clarify how to delimit identifiers (cherry picked from commit 0861affeca4d72938f05a2eceddfae2c19199071)
* | | | Match GHC, adding IsUnicodeSyntax field to HsFunTy and HsScaledAlan Zimmerman2020-10-211-3/+4
| | | | | | | | | | | | | | | | (cherry picked from commit a7d1d8e034d25612d5d08ed8fdbf6f472aded4a1)
* | | | Use functions exported from HsToCoreZubin Duggal2020-06-211-41/+0
| | | |
* | | | Adapt Haddock to LinearTypesKrzysztof Gogolewski2020-06-171-13/+19
| | | | | | | | | | | | | | | | See ghc/ghc!852.
* | | | Use HsForAllTelescope (GHC#18235)Ryan Scott2020-06-131-10/+22
| | | |
* | | | Changes for GHC#18191Ryan Scott2020-06-051-1/+4
| | | | | | | | | | | | | | | | See https://gitlab.haskell.org/ghc/ghc/-/merge_requests/3337.
* | | | Explicit Specificity Support for HaddockGert-Jan Bottu2020-05-201-9/+9
| | | |
* | | | add dependency on exceptions because GHC.Exception was boiled down (ghc #18075)Artem Pelenitsyn2020-05-031-5/+0
| | | |
* | | | Fix for GHC.Unit.* modulesSylvain Henry2020-04-271-2/+1
| | | |
* | | | Module structureSylvain Henry2020-04-241-5/+5
| | | |
* | | | Merge remote-tracking branch 'origin/ghc-head' into wip/ttg-con-patCale Gibbard2020-04-201-2/+2
|\ \ \ \
| * | | | Module renamingSylvain Henry2020-04-101-2/+2
| | | | |
* | | | | Rename XCollectPat -> CollectPassCale Gibbard2020-04-141-2/+2
| | | | |
* | | | | Add instance of XCollectPat for DocNameICale Gibbard2020-04-141-1/+2
|/ / / /
* | | | Make NoExtCon fields strictRyan Scott2020-04-071-13/+0
| | | | | | | | | | | | | | | | | | | | These changes are a part of a fix for [GHC#17992](https://gitlab.haskell.org/ghc/ghc/issues/17992).
* | | | Modules: TypesSylvain Henry2020-03-181-10/+10
| | | |
* | | | Modules: Core (#13009)Sylvain Henry2020-03-021-3/+3
| | | |
* | | | Modules: Driver (#13009)Sylvain Henry2020-02-191-2/+2
| | | |
* | | | Changes for GHC#17566Ryan Scott2020-01-251-2/+26
| | | | | | | | | | | | | | | | See https://gitlab.haskell.org/ghc/ghc/merge_requests/2469
* | | | Fix after Iface modules renamingSylvain Henry2020-01-021-1/+1
| | | |
* | | | Remove HasSrcSpan (#17494)Vladislav Zavialov2019-11-281-2/+2
| | | |
* | | | Import isRuntimeRepVar from Type rather than TyCoRepBen Gamari2019-11-091-1/+2
|/ / / | | | | | | | | | isRuntimeRepVar is not longer exported from TyCoRep due to ghc#17441.
* | | Small change in to facilitate extended typed-holes (#1090)Matthías Páll Gissurarson2019-09-281-4/+4
| | | | | | | | | This change has no functional effect on haddock itself, it just changes one pattern to use `_ (` rather than `_(`, so that we may use `_(` as a token for extended typed-holes later.
* | | Changes for #15247Ryan Scott2019-07-031-35/+55
| | |
* | | Visible dependent quantification (#16326) changesRyan Scott2019-02-271-5/+6
| | |
* | | Match GHC changes for T16185Alec Theriault2019-02-221-3/+3
|/ / | | | | | | | | | | | | `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.
* | Miscellaneous improvements to `Convert` (#1020)Alec Theriault2019-02-031-1/+109
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | Use `.hie` files for the Hyperlinker backend (#977)Alec Theriault2019-01-311-3/+131
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | # 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
* | Visible kind application haddock updatemynguyen2018-12-301-0/+2
| |
* | Refactor names + unused functions (#982)Alec Theriault2018-12-171-15/+0
| | | | | | | | | | | | | | 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
* | Fix warnings, accept outputAlec Theriault2018-12-121-2/+0
| | | | | | | | | | | | | | * 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
* | [TTG: Handling Source Locations] Foundation and PatShayan-Najd2018-11-231-3/+3
| | | | | | | | | | | | | | | | | | | | | | 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)`)
* | Refactor handling of parens in types (#874)Alec Theriault2018-07-201-0/+96
|/ | | | | | | | | | | | | | | | | | | | | | | | * Fix type parenthesization in Hoogle backend Ported the logic in the HTML and LaTeX backends for adding in parens into something top-level in 'GhcUtil'. Calling that from the Hoogle backend fixes #873. * Remove parenthesizing logic from LaTeX and XHTML backends Now, the only times that parenthesis in types are added in any backend is through the explicit 'HsParTy' constructor. Precedence is also represented as its own datatype. * List out cases explicitly vs. catch-all * Fix printing of parens for QuantifiedConstraints The priority of printing 'forall' types was just one too high. Fixes #877. * Accept HTML output for quantified contexts test
* Match changes in GHC for #14259Alan Zimmerman2018-06-191-2/+2
|
* Match changes in GHC for TTGAlan Zimmerman2018-04-271-17/+27
|
* Match GHC for TTG implemented on HsBinds, D4581Alan Zimmerman2018-04-131-22/+22
|
* Match GHC changes for TTGAlan Zimmerman2018-04-091-7/+47
|
* Haddock: support splitted include paths. (#689)Tamar Christina2018-02-191-1/+3
|
* Fix #732 (#733)Ryan Scott2018-01-191-2/+2
|
* Track changes to follow Trac #14529Simon Peyton Jones2017-12-071-1/+30
| | | | This tracks the refactoring of HsDecl.ConDecl.
* Revert "Match changes for Trees that Grow in GHC"Ben Gamari2017-11-211-1/+1
| | | | This reverts commit 01eeeb048acd2dd05ff6471ae148a97cf0720547.