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

Richard Feldman created

Closes #19155

Release Notes:

- Fixed code action for "Fix with assistant" appearing when assistant
was disabled.

Change summary

crates/assistant/src/inline_assistant.rs | 4 ++++
1 file changed, 4 insertions(+)

Detailed changes

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);