Assign the language registry to all buffers in the project

This commit is contained in:
Max Brunsfeld 2023-01-25 10:44:15 -08:00
parent a66a0cfd70
commit 7003a475a7

View file

@ -1480,6 +1480,10 @@ impl Project {
buffer: &ModelHandle<Buffer>,
cx: &mut ModelContext<Self>,
) -> 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);
}
});