editor: Show hints for using AI features on empty lines (#20824)

Co-Authored-by: Thorsten <thorsten@zed.dev>
Co-Authored-by: Antonio <antonio@zed.dev>

Screenshot:

![screenshot-2024-11-18-17 11
08@2x](https://github.com/user-attachments/assets/610fd7db-7476-4b9b-9465-a3d55df12340)

TODO:
- [x] docs

Release Notes:

- Added inline hints that guide users on how to invoke the inline
assistant and open the assistant panel. (These hints can be disabled by
setting `{"assistant": {"show_hints": false}}`.)

---------

Co-authored-by: Thorsten <thorsten@zed.dev>
Co-authored-by: Antonio <antonio@zed.dev>
Co-authored-by: Thorsten Ball <mrnugget@gmail.com>
This commit is contained in:
Bennet Bo Fenner 2024-11-19 09:41:44 +01:00 committed by GitHub
parent a35b73e63e
commit aae39071ef
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 283 additions and 83 deletions

View file

@ -200,18 +200,28 @@ You must provide the model's Context Window in the `max_tokens` parameter, this
{
"assistant": {
"enabled": true,
"show_hints": true,
"button": true,
"dock": "right"
"default_width": 480,
"default_model": {
"provider": "zed.dev",
"model": "claude-3-5-sonnet"
},
"version": "2",
"button": true,
"default_width": 480,
"dock": "right"
}
}
```
| key | type | default | description |
| -------------- | ------- | ------- | ------------------------------------------------------------------------------------- |
| enabled | boolean | true | Setting this to `false` will completely disable the assistant |
| show_hints | boolean | true | Whether to to show hints in the editor explaining how to use assistant |
| button | boolean | true | Show the assistant icon in the status bar |
| dock | string | "right" | The default dock position for the assistant panel. Can be ["left", "right", "bottom"] |
| default_height | string | null | The pixel height of the assistant panel when docked to the bottom |
| default_width | string | null | The pixel width of the assistant panel when docked to the left or right |
#### Custom endpoints {#custom-endpoint}
You can use a custom API endpoint for different providers, as long as it's compatible with the providers API structure.
@ -271,13 +281,3 @@ will generate two outputs for every assist. One with Claude 3.5 Sonnet, and one
}
}
```
#### Common Panel Settings
| key | type | default | description |
| -------------- | ------- | ------- | ------------------------------------------------------------------------------------- |
| enabled | boolean | true | Setting this to `false` will completely disable the assistant |
| button | boolean | true | Show the assistant icon in the status bar |
| dock | string | "right" | The default dock position for the assistant panel. Can be ["left", "right", "bottom"] |
| default_height | string | null | The pixel height of the assistant panel when docked to the bottom |
| default_width | string | null | The pixel width of the assistant panel when docked to the left or right |

View file

@ -2327,15 +2327,18 @@ Run the `theme selector: toggle` action in the command palette to see a current
- Default:
```json
"assistant": {
"enabled": true,
"button": true,
"dock": "right",
"default_width": 640,
"default_height": 320,
"provider": "openai",
"version": "1",
},
{
"assistant": {
"enabled": true,
"button": true,
"dock": "right",
"default_width": 640,
"default_height": 320,
"provider": "openai",
"version": "1",
"show_hints": true
}
}
```
## Outline Panel