diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:19:43 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:19:43 +0000 |
commit | 3e3e70d529d8c7d7c4d7bc4fefc9f109393b9245 (patch) | |
tree | daf049b282ab10e8c3d03e409b3cd84ff3f7690c /vendor/lsp-types/src/selection_range.rs | |
parent | Adding debian version 1.68.2+dfsg1-1. (diff) | |
download | rustc-3e3e70d529d8c7d7c4d7bc4fefc9f109393b9245.tar.xz rustc-3e3e70d529d8c7d7c4d7bc4fefc9f109393b9245.zip |
Merging upstream version 1.69.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/lsp-types/src/selection_range.rs')
-rw-r--r-- | vendor/lsp-types/src/selection_range.rs | 172 |
1 files changed, 86 insertions, 86 deletions
diff --git a/vendor/lsp-types/src/selection_range.rs b/vendor/lsp-types/src/selection_range.rs index 048df6f99..9ad110678 100644 --- a/vendor/lsp-types/src/selection_range.rs +++ b/vendor/lsp-types/src/selection_range.rs @@ -1,86 +1,86 @@ -use serde::{Deserialize, Serialize}; - -use crate::{ - PartialResultParams, Position, Range, StaticTextDocumentRegistrationOptions, - TextDocumentIdentifier, WorkDoneProgressOptions, WorkDoneProgressParams, -}; -#[derive(Debug, Eq, PartialEq, Clone, Default, Deserialize, Serialize)] -#[serde(rename_all = "camelCase")] -pub struct SelectionRangeClientCapabilities { - /// Whether implementation supports dynamic registration for selection range - /// providers. If this is set to `true` the client supports the new - /// `SelectionRangeRegistrationOptions` return value for the corresponding - /// server capability as well. - #[serde(skip_serializing_if = "Option::is_none")] - pub dynamic_registration: Option<bool>, -} - -#[derive(Debug, Eq, PartialEq, Clone, Default, Deserialize, Serialize)] -pub struct SelectionRangeOptions { - #[serde(flatten)] - pub work_done_progress_options: WorkDoneProgressOptions, -} - -#[derive(Debug, Eq, PartialEq, Clone, Deserialize, Serialize)] -pub struct SelectionRangeRegistrationOptions { - #[serde(flatten)] - pub selection_range_options: SelectionRangeOptions, - - #[serde(flatten)] - pub registration_options: StaticTextDocumentRegistrationOptions, -} - -#[derive(Debug, Eq, PartialEq, Clone, Deserialize, Serialize)] -#[serde(untagged)] -pub enum SelectionRangeProviderCapability { - Simple(bool), - Options(SelectionRangeOptions), - RegistrationOptions(SelectionRangeRegistrationOptions), -} - -impl From<SelectionRangeRegistrationOptions> for SelectionRangeProviderCapability { - fn from(from: SelectionRangeRegistrationOptions) -> Self { - Self::RegistrationOptions(from) - } -} - -impl From<SelectionRangeOptions> for SelectionRangeProviderCapability { - fn from(from: SelectionRangeOptions) -> Self { - Self::Options(from) - } -} - -impl From<bool> for SelectionRangeProviderCapability { - fn from(from: bool) -> Self { - Self::Simple(from) - } -} - -/// A parameter literal used in selection range requests. -#[derive(Debug, Eq, PartialEq, Clone, Deserialize, Serialize)] -#[serde(rename_all = "camelCase")] -pub struct SelectionRangeParams { - /// The text document. - pub text_document: TextDocumentIdentifier, - - /// The positions inside the text document. - pub positions: Vec<Position>, - - #[serde(flatten)] - pub work_done_progress_params: WorkDoneProgressParams, - - #[serde(flatten)] - pub partial_result_params: PartialResultParams, -} - -/// Represents a selection range. -#[derive(Debug, Eq, PartialEq, Clone, Default, Deserialize, Serialize)] -#[serde(rename_all = "camelCase")] -pub struct SelectionRange { - /// Range of the selection. - pub range: Range, - - /// The parent selection range containing this range. - #[serde(skip_serializing_if = "Option::is_none")] - pub parent: Option<Box<SelectionRange>>, -} +use serde::{Deserialize, Serialize};
+
+use crate::{
+ PartialResultParams, Position, Range, StaticTextDocumentRegistrationOptions,
+ TextDocumentIdentifier, WorkDoneProgressOptions, WorkDoneProgressParams,
+};
+#[derive(Debug, Eq, PartialEq, Clone, Default, Deserialize, Serialize)]
+#[serde(rename_all = "camelCase")]
+pub struct SelectionRangeClientCapabilities {
+ /// Whether implementation supports dynamic registration for selection range
+ /// providers. If this is set to `true` the client supports the new
+ /// `SelectionRangeRegistrationOptions` return value for the corresponding
+ /// server capability as well.
+ #[serde(skip_serializing_if = "Option::is_none")]
+ pub dynamic_registration: Option<bool>,
+}
+
+#[derive(Debug, Eq, PartialEq, Clone, Default, Deserialize, Serialize)]
+pub struct SelectionRangeOptions {
+ #[serde(flatten)]
+ pub work_done_progress_options: WorkDoneProgressOptions,
+}
+
+#[derive(Debug, Eq, PartialEq, Clone, Deserialize, Serialize)]
+pub struct SelectionRangeRegistrationOptions {
+ #[serde(flatten)]
+ pub selection_range_options: SelectionRangeOptions,
+
+ #[serde(flatten)]
+ pub registration_options: StaticTextDocumentRegistrationOptions,
+}
+
+#[derive(Debug, Eq, PartialEq, Clone, Deserialize, Serialize)]
+#[serde(untagged)]
+pub enum SelectionRangeProviderCapability {
+ Simple(bool),
+ Options(SelectionRangeOptions),
+ RegistrationOptions(SelectionRangeRegistrationOptions),
+}
+
+impl From<SelectionRangeRegistrationOptions> for SelectionRangeProviderCapability {
+ fn from(from: SelectionRangeRegistrationOptions) -> Self {
+ Self::RegistrationOptions(from)
+ }
+}
+
+impl From<SelectionRangeOptions> for SelectionRangeProviderCapability {
+ fn from(from: SelectionRangeOptions) -> Self {
+ Self::Options(from)
+ }
+}
+
+impl From<bool> for SelectionRangeProviderCapability {
+ fn from(from: bool) -> Self {
+ Self::Simple(from)
+ }
+}
+
+/// A parameter literal used in selection range requests.
+#[derive(Debug, Eq, PartialEq, Clone, Deserialize, Serialize)]
+#[serde(rename_all = "camelCase")]
+pub struct SelectionRangeParams {
+ /// The text document.
+ pub text_document: TextDocumentIdentifier,
+
+ /// The positions inside the text document.
+ pub positions: Vec<Position>,
+
+ #[serde(flatten)]
+ pub work_done_progress_params: WorkDoneProgressParams,
+
+ #[serde(flatten)]
+ pub partial_result_params: PartialResultParams,
+}
+
+/// Represents a selection range.
+#[derive(Debug, Eq, PartialEq, Clone, Default, Deserialize, Serialize)]
+#[serde(rename_all = "camelCase")]
+pub struct SelectionRange {
+ /// Range of the selection.
+ pub range: Range,
+
+ /// The parent selection range containing this range.
+ #[serde(skip_serializing_if = "Option::is_none")]
+ pub parent: Option<Box<SelectionRange>>,
+}
|