rust-lang / rust-lang/rust-analyzer
Redesign `rust-analyzer::flycheck`
@alibektas is already working on this.
Since Sep 25, 2024.
- Dominant language
- Rust
- Stars
- 16.9k
- Forks
- 2.2k
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 72
Description
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
- A thread pool will be used to avoid unnecessary initialization/destruction of threads. The number of threads will be configurable.
- Threads are used to execute whatever flycheck op is waiting to be executed. To map the results of a
flycheck' instance to the corresponding workspace, it was previously sufficient to keep aworkspace id'. The new model could use a hash ofworkspace_id * target * other things I can't think ofto compute an id. - More points to come in the next few days.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.