Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Use buffer's main language when fetching language tasks (#32580)

Kirill Bulatov9032ea9849fc
diff --git a/crates/project/src/task_inventory.rs b/crates/project/src/task_inventory.rs
index f2ce09a9b41..fa270f322a6 100644
--- a/crates/project/src/task_inventory.rs
+++ b/crates/project/src/task_inventory.rs
@@ -412,8 +412,7 @@ impl Inventory {
let fs = self.fs.clone();
let worktree = task_contexts.worktree();
let location = task_contexts.location();
- let language = location
- .and_then(|location| location.buffer.read(cx).language_at(location.range.start));
+ let language = location.and_then(|location| location.buffer.read(cx).language());
let task_source_kind = language.as_ref().map(|language| TaskSourceKind::Language {
name: language.name().into(),
});