Mountain/Vine/Server/Notification/UnregisterTaskProvider.rs
1#![allow(non_snake_case)]
2//! Cocoon → Mountain `unregister_task_provider` notification.
3//! Emitted by `Cocoon/.../TasksNamespace.ts:35` when
4//! `vscode.tasks.registerTaskProvider(...).dispose()` fires.
5
6use serde_json::Value;
7
8use crate::{Vine::Server::MountainVinegRPCService::MountainVinegRPCService, dev_log};
9
10pub async fn UnregisterTaskProvider(Service:&MountainVinegRPCService, Parameter:&Value) {
11 let Handle = Parameter.get("handle").and_then(Value::as_u64).unwrap_or(0) as u32;
12 if Handle == 0 {
13 dev_log!("provider-register", "[ProviderUnregister] task skip: missing handle");
14 return;
15 }
16 Service
17 .RunTime()
18 .Environment
19 .ApplicationState
20 .Extension
21 .ProviderRegistration
22 .UnregisterProvider(Handle);
23 dev_log!("provider-register", "[ProviderUnregister] task handle={}", Handle);
24}