Skip to content
This repository has been archived by the owner on Oct 7, 2020. It is now read-only.

When Errors are present goto goes to a empty temporary file #1286

Closed
Avi-D-coder opened this issue Jun 9, 2019 · 4 comments · Fixed by #1295
Closed

When Errors are present goto goes to a empty temporary file #1286

Avi-D-coder opened this issue Jun 9, 2019 · 4 comments · Fixed by #1295
Milestone

Comments

@Avi-D-coder
Copy link
Collaborator

Avi-D-coder commented Jun 9, 2019

If an error is present in app/Main.hs any goto on definition in the same file) will send me to empty file like /tmp/ghc-mod15112/Main15110-415110-22.hs

I'm using an update hie with alanz/ghc-mod#20.

@fendor
Copy link
Collaborator

fendor commented Jun 9, 2019

Does this happen only on this branch? Or did you only notice it on this branch?
Because, iirc, there is an issue about that somewhere.
Also, is there something to reproduce it?

@Avi-D-coder
Copy link
Collaborator Author

I noticed it on this branch, I have not had time to reproduce it on master.

@Avi-D-coder
Copy link
Collaborator Author

The issue exists on master

@wz1000
Copy link
Collaborator

wz1000 commented Jun 16, 2019

This occurs when we have a parsed module, but not a typechecked module, and is due to the update of reverse file map/rfm at

let newCI = (cachedInfo uc) { revMap = rfm }

We update the reverse file mapping according to the state of the mapped files when the parsed module is generated. However, the old typechecked module that is retained still contains SrcSpans generated according to the previous state of the mapped files. So, when we use information from the typechecked module to answer queries, we are not able to map the temporary file to the real file.

Hopefully this class of issues will be solved once and forall in GHC 8.8+ by @DanielG fixing GHCs support for memory mapped files. Until then, I am pushing a fix.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
4 participants