From 2fde20f46767e99033da1a8da19512b8a49493ce Mon Sep 17 00:00:00 2001 From: "gcp-cherry-pick-bot[bot]" <98988430+gcp-cherry-pick-bot[bot]@users.noreply.github.com> Date: Fri, 14 Feb 2025 15:44:59 +0100 Subject: [PATCH] edit predictions: Fix manually requesting completions (cherry-pick #24860) (#24869) Cherry-picked edit predictions: Fix manually requesting completions (#24860) We were disabling edit predictions altogether when `show_edit_predictions` was set to `false`. However, even in that case, `editor::ShowEditPrediction` is supposed to let your request a prediction manually. Release Notes: - Fixed `editor::ShowEditPrediction` when `show_edit_predictions` is set to `false`. Co-authored-by: Agus Zubiaga --- crates/editor/src/editor.rs | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/crates/editor/src/editor.rs b/crates/editor/src/editor.rs index 5679a9bd498502cc9c91aca313eb55dda2ec6cc7..b960f3e647eba84c8cf59248c92723066986b495 100644 --- a/crates/editor/src/editor.rs +++ b/crates/editor/src/editor.rs @@ -504,15 +504,6 @@ enum EditPredictionSettings { }, } -impl EditPredictionSettings { - pub fn is_enabled(&self) -> bool { - match self { - EditPredictionSettings::Disabled => false, - EditPredictionSettings::Enabled { .. } => true, - } - } -} - enum InlineCompletionHighlight {} pub enum MenuInlineCompletionsPolicy { @@ -5314,11 +5305,6 @@ impl Editor { self.edit_prediction_settings = self.edit_prediction_settings_at_position(&buffer, cursor_buffer_position, cx); - if !self.edit_prediction_settings.is_enabled() { - self.discard_inline_completion(false, cx); - return None; - } - self.edit_prediction_cursor_on_leading_whitespace = multibuffer.is_line_whitespace_upto(cursor);