lsp_max_protocol/
custom_methods.rs1use crate::lsp_3_18::LspRequest as Request;
2use crate::*;
3
4pub const METHOD_HOOK: &str = "max/hook";
10
11pub const METHOD_HOOK_GRAPH: &str = "max/hookGraph";
13
14pub const METHOD_CHAIN: &str = "max/chain";
16
17pub const METHOD_PROPAGATE: &str = "max/propagate";
19
20pub const METHOD_AUTONOMIC_LOOP: &str = "max/autonomicLoop";
22
23pub const METHOD_MANIFOLD_SNAPSHOT: &str = "max/manifoldSnapshot";
25
26pub const METHOD_LAWFUL_TRANSITION: &str = "max/lawfulTransition";
28
29pub const METHOD_ADMISSION: &str = "max/admission";
31
32pub const METHOD_REFUSAL: &str = "max/refusal";
34
35pub const METHOD_REPLAY: &str = "max/replay";
37
38pub const METHOD_RELEASE_ACTUATION: &str = "max/releaseActuation";
40
41pub const METHOD_LSIF_EXPORT: &str = "max/lsif";
43
44pub enum MaxSnapshot {}
47impl Request for MaxSnapshot {
48 type Params = ();
49 type Result = SnapshotId;
50 const METHOD: &'static str = "max/snapshot";
51}
52
53pub enum MaxConformanceVector {}
54impl Request for MaxConformanceVector {
55 type Params = SnapshotId;
56 type Result = ConformanceVector;
57 const METHOD: &'static str = "max/conformanceVector";
58}
59
60pub enum MaxExplainDiagnostic {}
61impl Request for MaxExplainDiagnostic {
62 type Params = String; type Result = MaxDiagnostic;
64 const METHOD: &'static str = "max/explainDiagnostic";
65}
66
67pub enum MaxRepairPlan {}
68impl Request for MaxRepairPlan {
69 type Params = String; type Result = Vec<MaxCodeAction>;
71 const METHOD: &'static str = "max/repairPlan";
72}
73
74pub enum MaxApplyRepairTransaction {}
75impl Request for MaxApplyRepairTransaction {
76 type Params = MaxCodeAction;
77 type Result = Receipt;
78 const METHOD: &'static str = "max/applyRepairTransaction";
79}
80
81pub enum MaxExportAnalysisBundle {}
82impl Request for MaxExportAnalysisBundle {
83 type Params = SnapshotId;
84 type Result = AnalysisBundle;
85 const METHOD: &'static str = "max/exportAnalysisBundle";
86}
87
88pub enum MaxRunGate {}
89impl Request for MaxRunGate {
90 type Params = GateId;
91 type Result = bool;
92 const METHOD: &'static str = "max/runGate";
93}
94
95pub enum MaxClearDiagnostic {}
96impl Request for MaxClearDiagnostic {
97 type Params = String; type Result = ();
99 const METHOD: &'static str = "max/clearDiagnostic";
100}
101
102pub enum MaxReceipt {}
103impl Request for MaxReceipt {
104 type Params = String; type Result = Receipt;
106 const METHOD: &'static str = "max/receipt";
107}
108
109pub enum MaxHook {}
112impl Request for MaxHook {
113 type Params = Option<String>; type Result = Vec<HookDescriptor>;
115 const METHOD: &'static str = "max/hook";
116}
117
118pub enum MaxHookGraph {}
119impl Request for MaxHookGraph {
120 type Params = Option<String>; type Result = Vec<HookGraphNode>;
122 const METHOD: &'static str = "max/hookGraph";
123}
124
125pub enum MaxChain {}
126impl Request for MaxChain {
127 type Params = Option<String>; type Result = Vec<ChainDescriptor>;
129 const METHOD: &'static str = "max/chain";
130}
131
132pub enum MaxPropagate {}
133impl Request for MaxPropagate {
134 type Params = String; type Result = PropagationResult;
136 const METHOD: &'static str = "max/propagate";
137}
138
139pub enum MaxAutonomicLoop {}
140impl Request for MaxAutonomicLoop {
141 type Params = Option<String>; type Result = AutonomicLoopStatus;
143 const METHOD: &'static str = "max/autonomicLoop";
144}
145
146pub enum MaxManifoldSnapshot {}
147impl Request for MaxManifoldSnapshot {
148 type Params = SnapshotId;
149 type Result = ManifoldSnapshot;
150 const METHOD: &'static str = "max/manifoldSnapshot";
151}
152
153pub enum MaxLawfulTransition {}
154impl Request for MaxLawfulTransition {
155 type Params = TransitionAttempt;
156 type Result = LawfulTransitionResult;
157 const METHOD: &'static str = "max/lawfulTransition";
158}
159
160pub enum MaxAdmission {}
161impl Request for MaxAdmission {
162 type Params = LawAxis;
163 type Result = AdmissionResult;
164 const METHOD: &'static str = "max/admission";
165}
166
167pub enum MaxRefusal {}
168impl Request for MaxRefusal {
169 type Params = LawAxis;
170 type Result = RefusalResult;
171 const METHOD: &'static str = "max/refusal";
172}
173
174pub enum MaxReplay {}
175impl Request for MaxReplay {
176 type Params = SnapshotId;
177 type Result = ReplayResult;
178 const METHOD: &'static str = "max/replay";
179}
180
181pub enum MaxReleaseActuation {}
182impl Request for MaxReleaseActuation {
183 type Params = SnapshotId;
184 type Result = ReleaseActuationResult;
185 const METHOD: &'static str = "max/releaseActuation";
186}
187
188pub const METHOD_RULE_PACKS: &str = "max/rulePacks";
193
194pub const METHOD_RULE_PACK_STATUS: &str = "max/rulePackStatus";
198
199pub const METHOD_RULE_PACK_DIFF: &str = "max/rulePackDiff";
202
203pub const METHOD_WORKSPACE_CONFORMANCE: &str = "max/workspaceConformance";
207
208#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
210pub struct RulePackDescriptor {
211 pub id: String,
213 pub version: String,
215 pub rule_ids: Vec<String>,
217 pub depends_on: Vec<String>,
219 pub active_rule_count: usize,
221}
222
223#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
225pub struct RulePackStatusResult {
226 pub pack_id: String,
228 pub findings_by_uri: std::collections::HashMap<String, Vec<String>>,
230 pub conformance: ConformanceVector,
232}
233
234#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
236pub struct RulePackDiffEntry {
237 pub rule_id: String,
239 pub uri: String,
241 pub line: u32,
243 pub change: String,
245}
246
247pub enum MaxRulePacks {}
248impl Request for MaxRulePacks {
249 type Params = ();
250 type Result = Vec<RulePackDescriptor>;
251 const METHOD: &'static str = "max/rulePacks";
252}
253
254pub enum MaxRulePackStatus {}
255impl Request for MaxRulePackStatus {
256 type Params = String; type Result = RulePackStatusResult;
258 const METHOD: &'static str = "max/rulePackStatus";
259}
260
261pub enum MaxRulePackDiff {}
262impl Request for MaxRulePackDiff {
263 type Params = (u64, u64); type Result = Vec<RulePackDiffEntry>;
265 const METHOD: &'static str = "max/rulePackDiff";
266}
267
268pub enum MaxWorkspaceConformance {}
269impl Request for MaxWorkspaceConformance {
270 type Params = ();
271 type Result = ConformanceVector;
272 const METHOD: &'static str = "max/workspaceConformance";
273}