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
This commit is contained in:
Kirill Bulatov 2025-06-12 00:14:21 +03:00 committed by GitHub
parent 8cc5b04045
commit 9032ea9849
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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(),
});