Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
snippets: Fix plaintext snippets not working (#28655)
loczek77544f42b1c9
diff --git a/crates/language/src/buffer.rs b/crates/language/src/buffer.rsindex aeb870288c0..0d6f797bc3c 100644--- a/crates/language/src/buffer.rs+++ b/crates/language/src/buffer.rs@@ -1376,11 +1376,20 @@ impl Buffer {/// Returns each [`Language`] for the active syntax layers at the given location.pub fn languages_at<D: ToOffset>(&self, position: D) -> Vec<Arc<Language>> {let offset = position.to_offset(self);- self.syntax_map+ let mut languages: Vec<Arc<Language>> = self+ .syntax_map.lock().layers_for_range(offset..offset, &self.text, false).map(|info| info.language.clone())- .collect()+ .collect();++ if languages.is_empty() {+ if let Some(buffer_language) = self.language() {+ languages.push(buffer_language.clone());+ }+ }++ languages}/// An integer version number that accounts for all updates besides