From 7003a475a7545c7eee7969be08f6a02925b26dc6 Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Wed, 25 Jan 2023 10:44:15 -0800 Subject: [PATCH] Assign the language registry to all buffers in the project --- crates/project/src/project.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/crates/project/src/project.rs b/crates/project/src/project.rs index f324865b5c..34117cf39e 100644 --- a/crates/project/src/project.rs +++ b/crates/project/src/project.rs @@ -1480,6 +1480,10 @@ impl Project { buffer: &ModelHandle, cx: &mut ModelContext, ) -> Result<()> { + buffer.update(cx, |buffer, _| { + buffer.set_language_registry(self.languages.clone()) + }); + let remote_id = buffer.read(cx).remote_id(); let open_buffer = if self.is_remote() || self.is_shared() { OpenBuffer::Strong(buffer.clone()) @@ -1803,7 +1807,6 @@ impl Project { if buffer.language().map_or(true, |old_language| { !Arc::ptr_eq(old_language, &new_language) }) { - buffer.set_language_registry(self.languages.clone()); buffer.set_language(Some(new_language.clone()), cx); } });