Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add garbage collect of diagnostics #713

Open
ndmitchell opened this issue Sep 24, 2019 · 4 comments
Open

Add garbage collect of diagnostics #713

ndmitchell opened this issue Sep 24, 2019 · 4 comments
Labels
component: ghcide performance Issues about memory consumption, responsiveness, etc. type: enhancement New feature or request

Comments

@ndmitchell
Copy link
Collaborator

Currently if you have a file open with errors, then shut it, the errors persist. The reason is that we don't have any sophisticated removal of non-interesting files, unlike what we have with DAML.

@pepeiborra
Copy link
Collaborator

I think that we want to at least keep the errors for dependencies of the current files of interest, those are very helpful. And I think that @mpickering may want a completely different behaviour here, as he typechecks all the targets at startup.

In implementation terms, we want to garbage collecting diagnostics which do not belong to the set of dependencies of the files of interest. This should happen after kick is done. There is some logic to do this already in the repo, but it is not being used and likely to be deleted as dead code and lost:
https://github.com/digital-asset/ghcide/blob/e16e841fa7e51b7950fd309196c1b16e51f95983/src/Development/IDE/Core/Shake.hs#L448-L462

@mpickering
Copy link
Contributor

garbageCollect should run when a file is deleted from the FOI HashSet, not on every kick in my opinion. (As in my opinion, nothing should run in kick as it adds costs to every call).

@ndmitchell
Copy link
Collaborator Author

I agree very little should run in kick, but if you have a file of interest A.hs which imports B.hs, then edit A.hs so it no longer imports B.hs, then any warnings shown as a result of B.hs should disappear if it's not included by another other root. In DAML we adjusted that logic, so only if A.hs parsed successfully did we trim B.hs, to avoid losing warnings on every parse error.

@jneira
Copy link
Member

jneira commented Sep 15, 2020

This continue happening with ghcide and hls master

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: ghcide performance Issues about memory consumption, responsiveness, etc. type: enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants