From bf9176e5bd36d02a98124b500f0150017f2bbf0e Mon Sep 17 00:00:00 2001 From: "gcp-cherry-pick-bot[bot]" <98988430+gcp-cherry-pick-bot[bot]@users.noreply.github.com> Date: Thu, 12 Jun 2025 00:28:35 +0300 Subject: [PATCH] Use buffer's main language when fetching language tasks (cherry-pick #32580) (#32581) Cherry-picked 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 Co-authored-by: Kirill Bulatov --- 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 0e4ca55c99f7e4666ba501499347151d41850a04..b842dd0c09992588bf4a8d71c0c0a150de9ab58e 100644 --- a/crates/project/src/task_inventory.rs +++ b/crates/project/src/task_inventory.rs @@ -369,8 +369,7 @@ impl Inventory { ) { 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(), });