haskell / haskell-ide-engine

The engine for haskell ide-integration. Not an IDE
BSD 3-Clause "New" or "Revised" License
2.38k stars 211 forks source link

Introduce service layer/support #753

Open alanz opened 6 years ago

alanz commented 6 years ago

I am looking at extending the support for liquid haskell, to include launching the liquid haskell exe when a file is saved.

But since these can be long-running processes, there are a whole lot of coordination issues around it, similar to what we already face for GHC via ghc-mod.

The essence of these is that we have a single thread doing the processing, a queue of pending tasks to be done, and the ability to cancel a given task if it becomes unnecessary or is superseded by another. e.g. an additional series of file changes, you only want to process the file in its final state.

And strictly speaking we should do the same for hlint processing too, although that is generally fast enough that it is not a problem.

But I think it may be worthwhile to abstract the processing queue model, so that it can be available for other diagnostics processors too, making it easier to plug them in.

lukel97 commented 6 years ago

We might also want to abstract IdeGhcM such that it is polymorphic on the thread it runs on. @Gurkenglas's recent work in refactoring it seems relevant