Migrate keymap and settings + edit predictions rename (#23834)
- [x] snake case keymap properties - [x] flatten actions - [x] keymap migration + notfication - [x] settings migration + notification - [x] inline completions -> edit predictions ### future: - keymap notification doesn't show up on start up, only on keymap save. this is existing bug in zed, will be addressed in seperate PR. Release Notes: - Added a notification for deprecated settings and keymaps, allowing you to migrate them with a single click. A backup of your existing keymap and settings will be created in your home directory. - Modified some keymap actions and settings for consistency. --------- Co-authored-by: Piotr Osiewicz <piotr@zed.dev> Co-authored-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
This commit is contained in:
parent
a1544f47ad
commit
00c2a30059
58 changed files with 2106 additions and 617 deletions
|
@ -31,16 +31,16 @@ pub fn init(client: Arc<Client>, cx: &mut App) {
|
|||
let supermaven = cx.new(|_| Supermaven::Starting);
|
||||
Supermaven::set_global(supermaven.clone(), cx);
|
||||
|
||||
let mut provider = all_language_settings(None, cx).inline_completions.provider;
|
||||
if provider == language::language_settings::InlineCompletionProvider::Supermaven {
|
||||
let mut provider = all_language_settings(None, cx).edit_predictions.provider;
|
||||
if provider == language::language_settings::EditPredictionProvider::Supermaven {
|
||||
supermaven.update(cx, |supermaven, cx| supermaven.start(client.clone(), cx));
|
||||
}
|
||||
|
||||
cx.observe_global::<SettingsStore>(move |cx| {
|
||||
let new_provider = all_language_settings(None, cx).inline_completions.provider;
|
||||
let new_provider = all_language_settings(None, cx).edit_predictions.provider;
|
||||
if new_provider != provider {
|
||||
provider = new_provider;
|
||||
if provider == language::language_settings::InlineCompletionProvider::Supermaven {
|
||||
if provider == language::language_settings::EditPredictionProvider::Supermaven {
|
||||
supermaven.update(cx, |supermaven, cx| supermaven.start(client.clone(), cx));
|
||||
} else {
|
||||
supermaven.update(cx, |supermaven, _cx| supermaven.stop());
|
||||
|
|
|
@ -2,7 +2,7 @@ use crate::{Supermaven, SupermavenCompletionStateId};
|
|||
use anyhow::Result;
|
||||
use futures::StreamExt as _;
|
||||
use gpui::{App, Context, Entity, EntityId, Task};
|
||||
use inline_completion::{Direction, InlineCompletion, InlineCompletionProvider};
|
||||
use inline_completion::{Direction, EditPredictionProvider, InlineCompletion};
|
||||
use language::{Anchor, Buffer, BufferSnapshot};
|
||||
use project::Project;
|
||||
use std::{
|
||||
|
@ -97,7 +97,7 @@ fn completion_from_diff(
|
|||
}
|
||||
}
|
||||
|
||||
impl InlineCompletionProvider for SupermavenCompletionProvider {
|
||||
impl EditPredictionProvider for SupermavenCompletionProvider {
|
||||
fn name() -> &'static str {
|
||||
"supermaven"
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue