1use serde::{Deserialize, Serialize};
2use url::Url;
34use crate::OneOf;
56#[derive(Debug, Eq, PartialEq, Clone, Default, Deserialize, Serialize)]
7#[serde(rename_all = "camelCase")]
8pub struct WorkspaceFoldersServerCapabilities {
9/// The server has support for workspace folders
10#[serde(skip_serializing_if = "Option::is_none")]
11pub supported: Option<bool>,
1213/// Whether the server wants to receive workspace folder
14 /// change notifications.
15 ///
16 /// If a string is provided, the string is treated as an ID
17 /// under which the notification is registered on the client
18 /// side. The ID can be used to unregister for these events
19 /// using the `client/unregisterCapability` request.
20#[serde(skip_serializing_if = "Option::is_none")]
21pub change_notifications: Option<OneOf<bool, String>>,
22}
2324#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Clone, Deserialize, Serialize)]
25#[serde(rename_all = "camelCase")]
26pub struct WorkspaceFolder {
27/// The associated URI for this workspace folder.
28pub uri: Url,
29/// The name of the workspace folder. Defaults to the uri's basename.
30pub name: String,
31}
3233#[derive(Debug, Eq, PartialEq, Clone, Default, Deserialize, Serialize)]
34#[serde(rename_all = "camelCase")]
35pub struct DidChangeWorkspaceFoldersParams {
36/// The actual workspace folder change event.
37pub event: WorkspaceFoldersChangeEvent,
38}
3940/// The workspace folder change event.
41#[derive(Debug, Eq, PartialEq, Clone, Default, Deserialize, Serialize)]
42#[serde(rename_all = "camelCase")]
43pub struct WorkspaceFoldersChangeEvent {
44/// The array of added workspace folders
45pub added: Vec<WorkspaceFolder>,
4647/// The array of the removed workspace folders
48pub removed: Vec<WorkspaceFolder>,
49}