Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'helix-lsp-types/src/lib.rs')
| -rw-r--r-- | helix-lsp-types/src/lib.rs | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/helix-lsp-types/src/lib.rs b/helix-lsp-types/src/lib.rs index 32b109fc..13db8b1e 100644 --- a/helix-lsp-types/src/lib.rs +++ b/helix-lsp-types/src/lib.rs @@ -369,6 +369,7 @@ impl From<&'static str> for PositionEncodingKind { /// Diagnostic objects are only valid in the scope of a resource. #[derive(Debug, Eq, PartialEq, Clone, Default, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] +#[derive(Hash)] pub struct Diagnostic { /// The range at which the message applies. pub range: Range, @@ -413,7 +414,7 @@ pub struct Diagnostic { pub data: Option<serde_json::Value>, } -#[derive(Debug, Eq, PartialEq, Clone, Deserialize, Serialize)] +#[derive(Debug, Eq, PartialEq, Clone, Deserialize, Serialize, Hash)] #[serde(rename_all = "camelCase")] pub struct CodeDescription { pub href: Url, @@ -458,7 +459,7 @@ impl Diagnostic { } /// The protocol currently supports the following diagnostic severities: -#[derive(Eq, PartialEq, Ord, PartialOrd, Clone, Copy, Deserialize, Serialize)] +#[derive(Eq, PartialEq, Ord, PartialOrd, Clone, Copy, Deserialize, Serialize, Hash)] #[serde(transparent)] pub struct DiagnosticSeverity(i32); lsp_enum! { @@ -477,7 +478,7 @@ impl DiagnosticSeverity { /// Represents a related message and source code location for a diagnostic. This /// should be used to point to code locations that cause or related to a /// diagnostics, e.g when duplicating a symbol in a scope. -#[derive(Debug, Eq, PartialEq, Clone, Deserialize, Serialize)] +#[derive(Debug, Eq, PartialEq, Clone, Deserialize, Serialize, Hash)] pub struct DiagnosticRelatedInformation { /// The location of this related diagnostic information. pub location: Location, @@ -487,7 +488,7 @@ pub struct DiagnosticRelatedInformation { } /// The diagnostic tags. -#[derive(Eq, PartialEq, Clone, Deserialize, Serialize)] +#[derive(Eq, PartialEq, Clone, Deserialize, Serialize, Hash)] #[serde(transparent)] pub struct DiagnosticTag(i32); lsp_enum! { @@ -508,7 +509,7 @@ impl DiagnosticTag { /// their execution on the server side if the client and server provides the corresponding capabilities. /// Alternatively the tool extension code could handle the command. /// The protocol currently doesn’t specify a set of well-known commands. -#[derive(Debug, PartialEq, Clone, Default, Deserialize, Serialize)] +#[derive(Debug, PartialEq, Clone, Default, Deserialize, Serialize, Hash)] pub struct Command { /// Title of the command, like `save`. pub title: String, @@ -944,7 +945,7 @@ impl WorkspaceEdit { } /// Text documents are identified using a URI. On the protocol level, URIs are passed as strings. -#[derive(Debug, Eq, PartialEq, Clone, Deserialize, Serialize)] +#[derive(Debug, Eq, PartialEq, Clone, Deserialize, Serialize, Hash)] pub struct TextDocumentIdentifier { // !!!!!! Note: // In the spec VersionedTextDocumentIdentifier extends TextDocumentIdentifier @@ -1038,7 +1039,7 @@ impl OptionalVersionedTextDocumentIdentifier { } /// A parameter literal used in requests to pass a text document and a position inside that document. -#[derive(Debug, Eq, PartialEq, Clone, Deserialize, Serialize)] +#[derive(Debug, Eq, PartialEq, Clone, Deserialize, Serialize, Hash)] #[serde(rename_all = "camelCase")] pub struct TextDocumentPositionParams { // !!!!!! Note: |