Skip to main content

Mountain/Vine/Server/Notification/
LanguagesSetDocumentLanguage.rs

1#![allow(non_snake_case)]
2//! Cocoon → Mountain `languages.setDocumentLanguage` notification.
3//! Emitted when an extension calls
4//! `vscode.languages.setTextDocumentLanguage(document, languageId)`.
5//! Forwarded verbatim to Sky on `sky://languages/setDocumentLanguage`
6//! so Monaco swaps the language mode on the matching editor.
7
8use serde_json::Value;
9use tauri::Emitter;
10
11use crate::{Vine::Server::MountainVinegRPCService::MountainVinegRPCService, dev_log};
12
13pub async fn LanguagesSetDocumentLanguage(Service:&MountainVinegRPCService, Parameter:&Value) {
14	if let Err(Error) = Service
15		.ApplicationHandle()
16		.emit("sky://languages/setDocumentLanguage", Parameter)
17	{
18		dev_log!(
19			"grpc",
20			"warn: [MountainVinegRPCService] sky://languages/setDocumentLanguage emit failed: {}",
21			Error
22		);
23	}
24}