1use crate::{
2 DynamicRegistrationClientCapabilities, LSPAny, PartialResultParams, Range,
3 StaticRegistrationOptions, SymbolKind, SymbolTag, TextDocumentPositionParams,
4 TextDocumentRegistrationOptions, Url, WorkDoneProgressOptions, WorkDoneProgressParams,
5};
67use serde::{Deserialize, Serialize};
89pub type TypeHierarchyClientCapabilities = DynamicRegistrationClientCapabilities;
1011#[derive(Debug, Eq, PartialEq, Clone, Default, Deserialize, Serialize)]
12pub struct TypeHierarchyOptions {
13#[serde(flatten)]
14pub work_done_progress_options: WorkDoneProgressOptions,
15}
1617#[derive(Debug, Eq, PartialEq, Clone, Default, Deserialize, Serialize)]
18pub struct TypeHierarchyRegistrationOptions {
19#[serde(flatten)]
20pub text_document_registration_options: TextDocumentRegistrationOptions,
21#[serde(flatten)]
22pub type_hierarchy_options: TypeHierarchyOptions,
23#[serde(flatten)]
24pub static_registration_options: StaticRegistrationOptions,
25}
2627#[derive(Debug, Eq, PartialEq, Clone, Deserialize, Serialize)]
28pub struct TypeHierarchyPrepareParams {
29#[serde(flatten)]
30pub text_document_position_params: TextDocumentPositionParams,
31#[serde(flatten)]
32pub work_done_progress_params: WorkDoneProgressParams,
33}
3435#[derive(Debug, Eq, PartialEq, Clone, Deserialize, Serialize)]
36pub struct TypeHierarchySupertypesParams {
37pub item: TypeHierarchyItem,
3839#[serde(flatten)]
40pub work_done_progress_params: WorkDoneProgressParams,
41#[serde(flatten)]
42pub partial_result_params: PartialResultParams,
43}
4445#[derive(Debug, Eq, PartialEq, Clone, Deserialize, Serialize)]
46pub struct TypeHierarchySubtypesParams {
47pub item: TypeHierarchyItem,
4849#[serde(flatten)]
50pub work_done_progress_params: WorkDoneProgressParams,
51#[serde(flatten)]
52pub partial_result_params: PartialResultParams,
53}
5455#[derive(Debug, Eq, PartialEq, Clone, Deserialize, Serialize)]
56#[serde(rename_all = "camelCase")]
57pub struct TypeHierarchyItem {
58/// The name of this item.
59pub name: String,
6061/// The kind of this item.
62pub kind: SymbolKind,
6364/// Tags for this item.
65#[serde(skip_serializing_if = "Option::is_none")]
66pub tags: Option<SymbolTag>,
6768/// More detail for this item, e.g. the signature of a function.
69#[serde(skip_serializing_if = "Option::is_none")]
70pub detail: Option<String>,
7172/// The resource identifier of this item.
73pub uri: Url,
7475/// The range enclosing this symbol not including leading/trailing whitespace
76 /// but everything else, e.g. comments and code.
77pub range: Range,
7879/// The range that should be selected and revealed when this symbol is being
80 /// picked, e.g. the name of a function. Must be contained by the
81 /// [`range`](#TypeHierarchyItem.range).
82pub selection_range: Range,
8384/// A data entry field that is preserved between a type hierarchy prepare and
85 /// supertypes or subtypes requests. It could also be used to identify the
86 /// type hierarchy in the server, helping improve the performance on
87 /// resolving supertypes and subtypes.
88#[serde(skip_serializing_if = "Option::is_none")]
89pub data: Option<LSPAny>,
90}