-
-
Notifications
You must be signed in to change notification settings - Fork 368
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
Generate linkables in the Eval plugin #2295
Conversation
Nice! I've been wanting to implement something like this for a while. However, I there are a few downsides if I understand this patch correctly:
|
Yes, that's right, there are some tradeoffs. Hold on, I think I know what you have in mind... |
Check now, was this still the plan? |
a2e057f
to
c056b1d
Compare
I found a bunch of other issues while testing, will extract separate PRs. |
6c83b01
to
8080777
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice. I may finally start enabling the Eval plugin for daily use.
The reasoning for the custom newness check is a bit subtle though, I think it would make sense to document it properly.
8080777
to
7dfc9eb
Compare
You may want to try it and see that it works for you now |
When I ported https://github.com/ndmitchell/shake/pull/802/files to hls-graph, I changed the encoding of the dirty set. Instead, Dirty became a constructor in the Status union. But the databaseDirtySet stayed around accidentally, leading to some confusion.
…hen Evaluating In addition, we tune the newness check of the redefined NeedsCompilation rule so that the generated linkables are not thrown away unnecessarily, as described in: ndmitchell/shake#794
e98625e
to
b3f4e9a
Compare
The intention is to move the codegen aspect of the Eval plugin away from the Interactive session and into the ghcide build graph. This should result in a much snappier user experience and hopefully also in a less flaky test suite.
The approach used is to redefine the NeedsCompilation rule adding a dependency on the GetEvalComments rule, so that whenever a module has
-- >>>
comments and it's open in the editor, the NeedsCompilation rule signals that a linkable is required. This should do what we need and, as far as I can see, has now downsides.This is the first time that we redefine a build rule in a plugin, but I've been using this trick in sigma-ide for a while now and it's safe.