This PR updates the `/docs` slash command with basic globbing support
for expanding docs.
A `*` can be added to the item path to signify the end of a prefix
match.
For example:
```
# This will match any documentation items starting with `auk::`.
# In this case, it will pull in the docs for each item in the crate.
/docs docs-rs auk::*
# This will match any documentation items starting with `auk::visitor::`,
# which will pull in docs for the `visitor` module.
/docs docs-rs auk::visitor::*
```
https://github.com/user-attachments/assets/5e1e21f1-241b-483f-9cd1-facc3aa76365
Release Notes:
- N/A
This PR improves the error message shown by the `/docs` slash command
when indexing fails due to the absence of `target/doc`.
We now distinguish between the overall `target/doc` directory missing
and an individual crate directory missing beneath it.
Release Notes:
- N/A
This PR updates the `/docs` slash command to show a warning to the user
if a crate's docs cannot be indexed due to the target directory not
containing docs:
<img width="782" alt="Screenshot 2024-07-11 at 5 11 46 PM"
src="https://github.com/user-attachments/assets/2f54f7a1-97f4-4d2d-b51f-57ba31e50a2f">
Release Notes:
- N/A
This PR adds a new `/docs` slash command to the Assistant. This slash
command replaces `/rustdoc`.
The `/docs` slash command works with different providers. There is
currently a built-in provider for rustdoc, but new providers can be
defined within extensions. The Gleam extension contains an example of
this.
When you first type `/docs` a completion menu will be shown with the
list of available providers:
https://github.com/zed-industries/zed/assets/1486634/32287000-5855-44d9-a2eb-569596f5abd9
After completing the provider you want to use then you can type the
package name and/or item path to search for the relevant docs:
https://github.com/zed-industries/zed/assets/1486634/6fc55a63-7fcd-42ea-80ce-08c670bf03fc
There are still some rough edges around completions that I would like to
get cleaned up in a future PR. Both of these seem to stem from the fact
that we're using an intermediate completion in the slash command:
1. Accepting a provider completion will show an error until you press
<kbd>Space</kbd> to continue typing.
- We need a way of not submitting a slash command when a completion is
accepted.
2. We currently need to show the provider name in the documentation item
completion list.
- Without it, the provider name gets wiped out when accepting a
completion, causing the slash command to become invalid.
Release Notes:
- N/A
This PR begins the process of making the backing infrastructure for the
`/rustdoc` command more generic such that it can be applied to
additional documentation providers.
In this PR we:
- Rename the `rustdoc` crate to `indexed_docs` as a more general-purpose
name
- Start moving rustdoc-specific functionality into
`indexed_docs::providers::rustdoc`
- Add an `IndexedDocsRegistry` to hold multiple `IndexedDocsStore`s (one
per provider)
We haven't yet removed the rustdoc-specific bits in the `DocsIndexer`.
That will follow soon.
Release Notes:
- N/A