Skip to main content

Mountain/Vine/Server/Notification/
LanguagesSetDocumentLanguage.rs

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