alpmestan / ghc.nix

Nix (shell) expression for working on GHC
https://haskell.org/ghc/
BSD 3-Clause "New" or "Revised" License
143 stars 51 forks source link

Add `find_note_def` to find the definition(s) of a Note #171

Closed sgraf812 closed 1 year ago

sgraf812 commented 1 year ago

Examples:

$ cd /path/to/ghc/checkout
$ find_note_def "Precise exceptions and Strictness analysis"
compiler/GHC/Types/Demand.hs:1548
$ echo $?
0
$ find_note_def Capital
$ echo $?
42
$ find_note_def Shadowing
compiler/GHC/Core/Opt/CSE.hs:56
compiler/GHC/Core/Opt/Simplify/Iteration.hs:123
compiler/GHC/Core/Opt/Simplify/Iteration.hs:2410
compiler/GHC/Core/Opt/SpecConstr.hs:267
compiler/GHC/Core.hs:316
$ echo $?
42

It uses ripgrep, so it's blazing fast. Using this works great for tooling.