wz1000 / HieDb

Generates a references DB from .hie files
BSD 3-Clause "New" or "Revised" License
64 stars 24 forks source link

addRefsFrom: Record real file names in database #38

Closed ttuegel closed 2 years ago

ttuegel commented 2 years ago

This is a small change to add the real source file name to the database when indexing an HieFile.

chrisdone commented 2 years ago

This is nice. I’d like to get a command that resolves a module to a .hs file, as my .hie files go in a .hie directory. Currently using a hack to guess the path.

wz1000 commented 2 years ago

This isn't quite correct, because hie_hs_file is a relative filepath, usually relative to the working directory of the GHC invocation that produced the .hie file. Storing this relative filepath is misleading and often just wrong.

If you really need this information, I would suggest adding an extra command line parameter which can be used to pass in the root directory to which hie_hs_file is considered relative. We would then need to use that to make the hie_hs_file absolute before storing that in the directory.