diff options
| author | Laurenz <laurmaedje@gmail.com> | 2023-08-21 11:14:08 +0200 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2023-08-21 11:14:08 +0200 |
| commit | 4b29bf6ff601970ff378d95f7f12db3bd64f95cf (patch) | |
| tree | f48eb397f51c0599c515de0068db7e560e08620d | |
| parent | 287556bc14f7e392ead11f7927536a0e24488936 (diff) | |
Implement `Serialize` and `Deserialize` for completions
| -rw-r--r-- | crates/typst/src/ide/complete.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/crates/typst/src/ide/complete.rs b/crates/typst/src/ide/complete.rs index 86b10d43..36d27654 100644 --- a/crates/typst/src/ide/complete.rs +++ b/crates/typst/src/ide/complete.rs @@ -3,6 +3,7 @@ use std::collections::{BTreeSet, HashSet}; use ecow::{eco_format, EcoString}; use if_chain::if_chain; +use serde::{Deserialize, Serialize}; use unscanny::Scanner; use super::analyze::analyze_labels; @@ -46,7 +47,7 @@ pub fn autocomplete( } /// An autocompletion option. -#[derive(Debug, Clone)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct Completion { /// The kind of item this completes to. pub kind: CompletionKind, @@ -62,7 +63,8 @@ pub struct Completion { } /// A kind of item that can be completed. -#[derive(Debug, Clone)] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(rename_all = "kebab-case")] pub enum CompletionKind { /// A syntactical structure. Syntax, |
