Open alibektas opened 2 months ago
Dumping some quick notes/thoughts:
Current architecture:
Notably, this has the downside that we can only check a single package (or target even) per workspace. We also can bring down the system if there are a lot of workspaces and we check all of them at once.
Also, we do want to keep the property of having at most one flycheck worker run for a given workspace (multiple is non-sensical as they will block on another for the cargo lock anyways).
So maybe a job queue isn't actually needed and we can keep the per workspace workers, from the looks of it we mainly need to make them more flexible wrt. the command they invoke?
The current implementation of flycheck is flawed in that it instantiates at most a single "flycheck instance" for each workspace. With the introduction of
rust-analyzer.toml
files, more fine-grained configuration has become possible. Therefore, we need more flexibility in flycheck instances. At the same time, we want to avoid having many `flycheck' threads, as this is clearly inefficient.Another issue that also needs to be addressed is how hard it is to test any kind of flycheck activity. The new model should make testing less of a problem for us.
Some key points about the new approach
flycheck' instance to the corresponding workspace, it was previously sufficient to keep a
workspace id'. The new model could use a hash ofworkspace_id * target * other things I can't think of
to compute an id.