Invalid,
}
+#[derive(Deserialize, Serialize)]
+pub struct StatusParams {
+ pub status: Status,
+}
+
impl Notification for StatusNotification {
- type Params = Status;
+ type Params = StatusParams;
const METHOD: &'static str = "rust-analyzer/status";
}
lsp_ext,
main_loop::Task,
};
+use lsp_ext::StatusParams;
impl GlobalState {
pub(crate) fn update_configuration(&mut self, config: Config) {
Status::Invalid => lsp_ext::Status::Invalid,
Status::NeedsReload => lsp_ext::Status::NeedsReload,
};
- self.send_notification::<lsp_ext::StatusNotification>(lsp_status);
+ self.send_notification::<lsp_ext::StatusNotification>(StatusParams {
+ status: lsp_status,
+ });
}
}
pub(crate) fn fetch_workspaces(&mut self) {
**Method:** `rust-analyzer/status`
-**Notification:** `"loading" | "ready" | "invalid" | "needsReload"`
+**Notification:**
+
+```typescript
+interface StatusParams {
+ status: "loading" | "ready" | "invalid" | "needsReload",
+}
+```
This notification is sent from server to client.
The client can use it to display persistent status to the user (in modline).
res.pushCleanup(client.start());
await client.onReady();
- client.onNotification(ra.status, (status) => res.setStatus(status));
+ client.onNotification(ra.status, (params) => res.setStatus(params.status));
return res;
}
export const memoryUsage = new lc.RequestType<null, string, void>("rust-analyzer/memoryUsage");
export type Status = "loading" | "ready" | "invalid" | "needsReload";
-export const status = new lc.NotificationType<Status>("rust-analyzer/status");
+export interface StatusParams {
+ status: Status;
+}
+export const status = new lc.NotificationType<StatusParams>("rust-analyzer/status");
export const reloadWorkspace = new lc.RequestType<null, null, void>("rust-analyzer/reloadWorkspace");