From 9032ea9849fcb55ab99d63f4fae476341e12aecb Mon Sep 17 00:00:00 2001 From: Kirill Bulatov Date: Thu, 12 Jun 2025 00:14:21 +0300 Subject: [PATCH] Use buffer's main language when fetching language tasks (#32580) Closes https://github.com/zed-industries/zed/issues/32465 Release Notes: - Fixed language tasks fetched incorrectly for certain selections --- crates/project/src/task_inventory.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/crates/project/src/task_inventory.rs b/crates/project/src/task_inventory.rs index f2ce09a9b4197c11ce3ec5b639b205942022bc3a..fa270f322a621231ebde3036e249d328c03398c7 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(), });