Respect project-specific settings for copilot

This commit is contained in:
Max Brunsfeld 2023-05-31 14:42:15 -07:00
parent eeba72d775
commit a2ab7c9eb9
6 changed files with 56 additions and 40 deletions

View file

@ -26,8 +26,14 @@ pub fn language_settings<'a>(
.language(language)
}
pub fn all_language_settings<'a>(cx: &'a AppContext) -> &'a AllLanguageSettings {
settings::get::<AllLanguageSettings>(cx)
pub fn all_language_settings<'a>(
file: Option<&dyn File>,
cx: &'a AppContext,
) -> &'a AllLanguageSettings {
settings::get_local::<AllLanguageSettings>(
file.map(|f| (f.worktree_id(), f.path().as_ref())),
cx,
)
}
#[derive(Debug, Clone)]