laburnum 1.17.0

An LSP framework for building language servers and compilers, powered by an incremental query tree with content-addressed storage, task-based dataflow, and parallel queries.
Documentation
// Copyright Two Neutron Stars Incorporated and contributors
// SPDX-License-Identifier: BlueOak-1.0.0

use {
  crate::{
    Uri,
    protocol::lsp::OneOf,
  },
  serde::{
    Deserialize,
    Serialize,
  },
};

#[derive(Debug, Default, Clone, PartialEq, Eq, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct WorkspaceFoldersServerCapabilities {
  /// The server has support for workspace folders
  #[serde(skip_serializing_if = "Option::is_none")]
  pub supported: Option<bool>,

  /// Whether the server wants to receive workspace folder
  /// change notifications.
  ///
  /// If a string is provided, the string is treated as an ID
  /// under which the notification is registered on the client
  /// side. The ID can be used to unregister for these events
  /// using the `client/unregisterCapability` request.
  #[serde(skip_serializing_if = "Option::is_none")]
  pub change_notifications: Option<OneOf<bool, String>>,
}

#[derive(
  Debug, Clone, Hash, PartialEq, Eq, PartialOrd, Ord, Deserialize, Serialize,
)]
#[serde(rename_all = "camelCase")]
pub struct WorkspaceFolder {
  /// The associated URI for this workspace folder.
  pub uri:  Uri,
  /// The name of the workspace folder. Defaults to the uri's basename.
  pub name: String,
}

#[derive(Debug, Default, Clone, PartialEq, Eq, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct DidChangeWorkspaceFoldersParams {
  /// The actual workspace folder change event.
  pub event: WorkspaceFoldersChangeEvent,
}

/// The workspace folder change event.
#[derive(Debug, Default, Clone, PartialEq, Eq, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct WorkspaceFoldersChangeEvent {
  /// The array of added workspace folders
  pub added: Vec<WorkspaceFolder>,

  /// The array of the removed workspace folders
  pub removed: Vec<WorkspaceFolder>,
}