use crate::{
LSPAny, Location, OneOf, PartialResultParams, SymbolInformation, SymbolKind,
SymbolKindCapability, SymbolTag, TagSupport, Url, WorkDoneProgressParams,
};
use serde::{Deserialize, Serialize};
#[derive(Debug, Eq, PartialEq, Clone, Default, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct WorkspaceSymbolClientCapabilities {
#[serde(skip_serializing_if = "Option::is_none")]
pub dynamic_registration: Option<bool>,
#[serde(skip_serializing_if = "Option::is_none")]
pub symbol_kind: Option<SymbolKindCapability>,
#[serde(
default,
skip_serializing_if = "Option::is_none",
deserialize_with = "TagSupport::deserialize_compat"
)]
pub tag_support: Option<TagSupport<SymbolTag>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub resolve_support: Option<WorkspaceSymbolResolveSupportCapability>,
}
#[derive(Debug, Eq, PartialEq, Clone, Default, Deserialize, Serialize)]
pub struct WorkspaceSymbolParams {
#[serde(flatten)]
pub partial_result_params: PartialResultParams,
#[serde(flatten)]
pub work_done_progress_params: WorkDoneProgressParams,
pub query: String,
}
#[derive(Debug, Eq, PartialEq, Clone, Default, Deserialize, Serialize)]
pub struct WorkspaceSymbolResolveSupportCapability {
pub properties: Vec<String>,
}
#[derive(Debug, Eq, PartialEq, Clone, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct WorkspaceSymbol {
pub name: String,
pub kind: SymbolKind,
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<Vec<SymbolTag>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub container_name: Option<String>,
pub location: OneOf<Location, WorkspaceLocation>,
#[serde(skip_serializing_if = "Option::is_none")]
pub data: Option<LSPAny>,
}
#[derive(Debug, Eq, PartialEq, Clone, Deserialize, Serialize)]
pub struct WorkspaceLocation {
pub uri: Url,
}
#[derive(Debug, Eq, PartialEq, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum WorkspaceSymbolResponse {
Flat(Vec<SymbolInformation>),
Nested(Vec<WorkspaceSymbol>),
}