Mountain/RPC/
workspace.rs

1//! # Workspace RPC Service
2//!
3//! Workspace service for file and workspace operations.
4
5use std::path::PathBuf;
6
7use serde::{Deserialize, Serialize};
8
9/// Workspace service
10pub struct WorkspaceService {
11	workspace_root:Option<PathBuf>,
12}
13
14impl WorkspaceService {
15	pub fn new() -> Self { Self { workspace_root:None } }
16
17	pub fn with_root(root:PathBuf) -> Self { Self { workspace_root:Some(root) } }
18}
19
20impl Default for WorkspaceService {
21	fn default() -> Self { Self::new() }
22}
23
24/// Workspace folder
25#[derive(Debug, Clone, Serialize, Deserialize)]
26pub struct WorkspaceFolder {
27	pub uri:String,
28	pub name:String,
29}
30
31/// Text document info
32#[derive(Debug, Clone, Serialize, Deserialize)]
33pub struct TextDocumentInfo {
34	pub uri:String,
35	pub version:i32,
36	pub language_id:String,
37}