1use serde::Deserialize;
2
3use crate::base::TokenBased;
4use crate::pos::InteractionPoint;
5
6pub use self::di::*;
7pub use self::give::*;
8pub use self::goal::*;
9pub use self::hl::*;
10pub use self::oc::*;
11
12mod di;
14mod give;
16mod goal;
18mod hl;
20mod oc;
22
23#[serde(rename_all = "camelCase")]
24#[derive(Deserialize, Clone, Debug, Eq, PartialEq)]
25pub struct MakeCase {
26 pub variant: MakeCaseVariant,
27 pub interaction_point: InteractionPoint,
28 pub clauses: Vec<String>,
29}
30
31#[serde(rename_all = "camelCase")]
33#[derive(Deserialize, Clone, Default, Debug, Eq, PartialEq, Hash)]
34pub struct Status {
35 pub show_implicit_arguments: bool,
37 pub checked: bool,
39}
40
41#[derive(Deserialize, Copy, Clone, Debug, Eq, PartialEq, Hash)]
42pub enum MakeCaseVariant {
43 Function,
44 ExtendedLambda,
45}
46
47#[serde(rename_all = "camelCase")]
48#[derive(Deserialize, Clone, Debug, Eq, PartialEq)]
49pub struct OneSolution {
50 pub interaction_point: InteractionPoint,
51 pub expression: String,
52}
53
54#[serde(tag = "kind")]
56#[derive(Deserialize, Clone, Debug, Eq, PartialEq)]
57pub enum Resp {
58 HighlightingInfo(HighlightingInfo),
59 Status {
60 status: Status,
61 },
62 JumpToError {
63 filepath: String,
64 position: i32,
65 },
66 InteractionPoints {
67 #[serde(rename = "interactionPoints")]
68 interaction_points: Vec<InteractionPoint>,
69 },
70 GiveAction(GiveAction),
71 MakeCase(MakeCase),
73 SolveAll {
75 solutions: Vec<OneSolution>,
76 },
77 DisplayInfo {
78 info: Option<DisplayInfo>,
79 },
80 RunningInfo {
82 #[serde(rename = "debugLevel")]
83 debug_level: i32,
84 message: String,
85 },
86 ClearRunningInfo,
87 ClearHighlighting {
89 #[serde(rename = "tokenBased")]
90 token_based: TokenBased,
91 },
92 DoneAborting,
94}