# assistant: Allow \`/docs\` to perform JIT indexing when run \(\#14768\) · gitcafe/zed

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

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

Visibility: public

Requested revision: ad3055076d146c49c1986286c142b4bee5bad99c

Requested commit: ad3055076d146c49c1986286c142b4bee5bad99c

Commit: ad3055076d146c49c1986286c142b4bee5bad99c

Tree: 6a50392c55f28092e98ffd34892b6d442cb49f27

Author: Marshall Bowers

Committer: GitHub

## Message

```
assistant: Allow `/docs` to perform JIT indexing when run (#14768)

This PR updates the `/docs` slash command with the ability to
just-in-time index a package when there are not yet any results in the
index.

When running a `/docs` slash command, we fist check to see if there are
any results in the index that would match the search.

If there are, we go ahead and return them, as we do today.

However, if there are not yet any results we kick off an indexing task
as part of the command execution to fetch the results.

Release Notes:

- N/A
```

## Parents

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

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