inline completions: Add action to toggle inline completions (#16947)

This adds a new action: `editor: toggle inline completions`.

It allows users to toggle inline completions on/off for the current
buffer.

That toggling is not persistent and when the editor is closed, it's
gone.

That makes it easy to disable inline completions for a single text
buffer, for example, even if you want them on for other buffers.

When toggling on/off, the toggling also overwrites any language
settings. So if you have inline completions disabled for Go buffers,
toggling them on takes precedence over those settings.


Release Notes:

- Added a new editor action to allow toggling inline completions
(Copilot, Supermaven) on and off for the current buffer, taking
precedence over any settings.

Co-authored-by: Antonio <antonio@zed.dev>
This commit is contained in:
Thorsten Ball 2024-08-27 15:51:57 +02:00 committed by GitHub
parent 5586397f95
commit ad43bbbf5e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 56 additions and 16 deletions

View file

@ -186,7 +186,7 @@ impl FeedbackModal {
);
editor.set_show_gutter(false, cx);
editor.set_show_indent_guides(false, cx);
editor.set_show_inline_completions(false);
editor.set_show_inline_completions(Some(false), cx);
editor.set_vertical_scroll_margin(5, cx);
editor.set_use_modal_editing(false);
editor