debugger: Ensure both debug and regular global tasks are correctly merged (#27184)

Follow-up of https://github.com/zed-industries/zed/pull/13433
Closes https://github.com/zed-industries/zed/issues/27124
Closes https://github.com/zed-industries/zed/issues/27066

After this change, both old global task source, `tasks.json` and new,
`debug.json` started to call for the same task update method:


14920ab910/crates/project/src/task_inventory.rs (L414)

erasing previous declarations.

The PR puts this data under different paths instead and adjusts the code
around it.

Release Notes:

- Fixed custom tasks not shown
This commit is contained in:
Kirill Bulatov 2025-03-20 14:51:26 +02:00 committed by GitHub
parent 5bef32f3ed
commit de99febd9b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 57 additions and 35 deletions

View file

@ -1,6 +1,6 @@
#![allow(clippy::format_collect)]
use crate::{task_inventory::TaskContexts, Event, *};
use crate::{task_inventory::TaskContexts, task_store::TaskSettingsLocation, Event, *};
use buffer_diff::{
assert_hunks, BufferDiffEvent, DiffHunkSecondaryStatus, DiffHunkStatus, DiffHunkStatusKind,
};
@ -19,6 +19,7 @@ use lsp::{
NumberOrString, TextDocumentEdit, WillRenameFiles,
};
use parking_lot::Mutex;
use paths::tasks_file;
use pretty_assertions::{assert_eq, assert_matches};
use serde_json::json;
#[cfg(not(windows))]
@ -327,7 +328,7 @@ async fn test_managing_project_specific_settings(cx: &mut gpui::TestAppContext)
inventory.task_scheduled(topmost_local_task_source_kind.clone(), resolved_task);
inventory
.update_file_based_tasks(
None,
TaskSettingsLocation::Global(tasks_file()),
Some(
&json!([{
"label": "cargo check unstable",