From ff6662052db2baa55f5499f8ee52fe38b0b121e7 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:31:01 +0300 Subject: [PATCH] Use buffer's main language when fetching language tasks (cherry-pick #32580) (#32582) 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 539a30c361defb15813fa0c7fdcd3b3b0dac5520..6fc02907c4164c8afda4ced0d89d3c8d2210e419 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(), });