Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
  • GHC GHC
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 4,970
    • Issues 4,970
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 479
    • Merge requests 479
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Releases
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Glasgow Haskell Compiler
  • GHCGHC
  • Merge requests
  • !1286

Add info about typeclass evidence to .hie files

  • Review changes

  • Download
  • Email patches
  • Plain diff
Closed Zubin requested to merge wz1000/ghc:hiefile-typeclass-info into master Jun 25, 2019
  • Overview 51
  • Commits 1
  • Pipelines 42
  • Changes 11

See testsuite/tests/hiefile/should_run/HieQueries.hs and testsuite/tests/hiefile/should_run/HieQueries.stdout for an example of this

We add two new fields, EvidenceVarBind and EvidenceVarUse to the ContextInfo associated with an Identifier. These contexts are associated with the appropriate identifiers for the evidence variables collected when we come across HsWrappers, TcEvBinds and IPBinds while traversing the AST. This allows us to save a complete picture of the evidence constructed by the constraint solver, and will let us report this to the user, enabling features like going to the instance definition from the invocation of a class method(or any other method taking a constraint) and finding all usages of a particular instance.

Additionally, we mark NodeInfo with a NodeOrigin flag that tells us about the provenance of the node(whether it is from the source or generated by GHC). For now, this corresponds to the Origin field in the MatchGroup. This helps us ensure we don't display irrelevant information in hover tooltips generated by haddocks hyperlinker. It is necessary because we now recurse into the MatchGroup without guarding for the FromSource origin, so that we can collect all the typeclass evidence information required.

Fixes #17222

Edited May 20, 2020 by Zubin
Assignee
Assign to
Reviewer
Request review from
Time tracking
Source branch: hiefile-typeclass-info