Clarify copilot settings

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
Antonio Scandurra 2023-04-19 20:07:05 +02:00
parent c5e56a5e45
commit 1fd07b6fcf
5 changed files with 73 additions and 88 deletions

View file

@ -2816,7 +2816,10 @@ impl Editor {
let snapshot = self.buffer.read(cx).snapshot(cx);
let cursor = self.selections.newest_anchor().head();
let language_name = snapshot.language_at(cursor).map(|language| language.name());
if !cx.global::<Settings>().copilot_on(language_name.as_deref()) {
if !cx
.global::<Settings>()
.show_copilot_suggestions(language_name.as_deref())
{
self.hide_copilot_suggestion(cx);
return None;
}