# zeta2 cli: Resumable LSP declarations gathering \(\#39828\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/a693d445532629f5fe506485e3671063c040777b)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: a693d445532629f5fe506485e3671063c040777b

Requested commit: a693d445532629f5fe506485e3671063c040777b

Commit: a693d445532629f5fe506485e3671063c040777b

Tree: f35b7d71c17f6f118081ab4ccdd9fd3bcc263218

Author: Agus Zubiaga

Committer: GitHub

## Message

```
zeta2 cli: Resumable LSP declarations gathering (#39828)

Gathering LSP declarations in zeta_cli can take a really long time for
big repos and has to be started from scratch if interrupted.

Instead of writing the cache file once we have walked the whole
worktree, we'll now do so incrementally as we complete each file. On
subsequent runs, we'll load as many valid declarations as has been
previously written to the cache, and then continue to request the rest
from the LSP which will append to the existing file as it makes
progress. If the last cache entry is incomplete, we'll truncate the
cache file to the end of the last valid line and continue from there, so
we can just `ctrl-c` without breaking resumability.

Release Notes:

- N/A
```

## Parents

- [41ee92e5f2c9d58defb3cc3946940d492c39d756](https://git.cafe/gitcafe/zed/commit/41ee92e5f2c9d58defb3cc3946940d492c39d756?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/a693d445532629f5fe506485e3671063c040777b?format=markdown)
