Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Don't suggest assistant code actions if it's disabled (#19553)

Richard Feldmance11ca9d4983
diff --git a/crates/assistant/src/inline_assistant.rs b/crates/assistant/src/inline_assistant.rs
index a11d4113d87..6a80813f342 100644
--- a/crates/assistant/src/inline_assistant.rs
+++ b/crates/assistant/src/inline_assistant.rs
@@ -3277,6 +3277,10 @@ impl CodeActionProvider for AssistantCodeActionProvider {
range: Range<text::Anchor>,
cx: &mut WindowContext,
) -> Task<Result<Vec<CodeAction>>> {
+ if !AssistantSettings::get_global(cx).enabled {
+ return Task::ready(Ok(Vec::new()));
+ }
+
let snapshot = buffer.read(cx).snapshot();
let mut range = range.to_point(&snapshot);