Skip to content
Snippets Groups Projects
  1. Jan 31, 2019
    • Alec Theriault's avatar
      Use `.hie` files for the Hyperlinker backend (#977) · 9fea0dc8
      Alec Theriault authored
      # 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
      9fea0dc8
  2. Jun 13, 2018
  3. May 08, 2018
    • Alec Theriault's avatar
      Remove 'TokenGroup' from Hyperlinker (#818) · b1b4e070
      Alec Theriault authored and Alex Biehl's avatar Alex Biehl committed
      Since the hyperlinker backend now relies on the GHC tokenizer, something
      like 'Bar.Baz.foo' already gets bunched together into one token (as
      opposed to being spread across 'Bar', '.', 'Baz', '.', and 'foo').
      b1b4e070
  4. Feb 01, 2018
    • Alexander Biehl's avatar
      Warning free compilation · 3af679f0
      Alexander Biehl authored and Alex Biehl's avatar Alex Biehl committed
      3af679f0
    • Alec Theriault's avatar
      Use the GHC lexer for the Hyperlinker backend (#714) · 3797e079
      Alec Theriault authored and Alex Biehl's avatar Alex Biehl committed
      * 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
      3797e079
  5. Aug 02, 2015
  6. Jul 06, 2015
  7. Jul 05, 2015
  8. Jul 01, 2015
  9. Jun 30, 2015
Loading