Remove per-file copilot enable/disable

This commit is contained in:
Mikayla Maki 2023-04-03 15:15:42 -07:00
parent 0250898a2b
commit 48d9c30b0e
4 changed files with 14 additions and 90 deletions

View file

@ -249,19 +249,6 @@ impl CopilotButton {
let mut menu_options = Vec::with_capacity(6);
if let Some((_, view_id)) = self.editor_subscription.as_ref() {
let locally_enabled = self.editor_enabled.unwrap_or(settings.copilot_on(None));
menu_options.push(ContextMenuItem::item_for_view(
if locally_enabled {
"Pause Copilot for this file"
} else {
"Resume Copilot for this file"
},
*view_id,
copilot::Toggle,
));
}
if let Some(language) = &self.language {
let language_enabled = settings.copilot_on(Some(language.as_ref()));
@ -334,11 +321,7 @@ impl CopilotButton {
self.language = language_name.clone();
if let Some(enabled) = editor.copilot_state.user_enabled {
self.editor_enabled = Some(enabled);
} else {
self.editor_enabled = Some(settings.copilot_on(language_name.as_deref()));
}
self.editor_enabled = Some(settings.copilot_on(language_name.as_deref()));
cx.notify()
}