Fix edit prediction disablement with "disable_ai": true setting (#35513)

Even after #35327 edit predictions were still being queried and shown
after setting `"disable_ai": true`

Also moves `DisableAiSettings` to the `project` crate so that it gets
included in tests via existing use of `Project::init_settings(cx)`.

Release Notes:

- Fixed `"disable_ai": true` setting disabling edit predictions.
This commit is contained in:
Michael Sloan 2025-08-04 09:45:11 -06:00 committed by GitHub
parent d577ef52cb
commit 899bc8a8fd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
17 changed files with 60 additions and 54 deletions

View file

@ -23,7 +23,6 @@ askpass.workspace = true
buffer_diff.workspace = true
call.workspace = true
chrono.workspace = true
client.workspace = true
cloud_llm_client.workspace = true
collections.workspace = true
command_palette_hooks.workspace = true

View file

@ -1,9 +1,9 @@
use crate::branch_picker::{self, BranchList};
use crate::git_panel::{GitPanel, commit_message_editor};
use client::DisableAiSettings;
use git::repository::CommitOptions;
use git::{Amend, Commit, GenerateCommitMessage, Signoff};
use panel::{panel_button, panel_editor_style};
use project::DisableAiSettings;
use settings::Settings;
use ui::{
ContextMenu, KeybindingHint, PopoverMenu, PopoverMenuHandle, SplitButton, Tooltip, prelude::*,

View file

@ -12,7 +12,6 @@ use crate::{
use agent_settings::AgentSettings;
use anyhow::Context as _;
use askpass::AskPassDelegate;
use client::DisableAiSettings;
use db::kvp::KEY_VALUE_STORE;
use editor::{
Editor, EditorElement, EditorMode, EditorSettings, MultiBuffer, ShowScrollbar,
@ -51,10 +50,9 @@ use panel::{
PanelHeader, panel_button, panel_editor_container, panel_editor_style, panel_filled_button,
panel_icon_button,
};
use project::git_store::{RepositoryEvent, RepositoryId};
use project::{
Fs, Project, ProjectPath,
git_store::{GitStoreEvent, Repository},
DisableAiSettings, Fs, Project, ProjectPath,
git_store::{GitStoreEvent, Repository, RepositoryEvent, RepositoryId},
};
use serde::{Deserialize, Serialize};
use settings::{Settings, SettingsStore};
@ -5115,7 +5113,6 @@ mod tests {
language::init(cx);
editor::init(cx);
Project::init_settings(cx);
client::DisableAiSettings::register(cx);
crate::init(cx);
});
}