summaryrefslogtreecommitdiffstats
path: root/src/tools/rust-analyzer/docs/dev/lsp-extensions.md
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools/rust-analyzer/docs/dev/lsp-extensions.md')
-rw-r--r--src/tools/rust-analyzer/docs/dev/lsp-extensions.md67
1 files changed, 66 insertions, 1 deletions
diff --git a/src/tools/rust-analyzer/docs/dev/lsp-extensions.md b/src/tools/rust-analyzer/docs/dev/lsp-extensions.md
index fe316fcae..a4780af1a 100644
--- a/src/tools/rust-analyzer/docs/dev/lsp-extensions.md
+++ b/src/tools/rust-analyzer/docs/dev/lsp-extensions.md
@@ -1,5 +1,5 @@
<!---
-lsp_ext.rs hash: 62068e53ac202dc8
+lsp_ext.rs hash: 45bd7985265725c5
If you need to change the above hash to make the test pass, please check if you
need to adjust this doc as well and ping this issue:
@@ -459,6 +459,45 @@ Note that this functionality is intended primarily to inform the end user about
In particular, it's valid for the client to completely ignore this extension.
Clients are discouraged from but are allowed to use the `health` status to decide if it's worth sending a request to the server.
+### Controlling Flycheck
+
+The flycheck/checkOnSave feature can be controlled via notifications sent by the client to the server.
+
+**Method:** `rust-analyzer/runFlycheck`
+
+**Notification:**
+
+```typescript
+interface RunFlycheckParams {
+ /// The text document whose cargo workspace flycheck process should be started.
+ /// If the document is null or does not belong to a cargo workspace all flycheck processes will be started.
+ textDocument: lc.TextDocumentIdentifier | null;
+}
+```
+
+Triggers the flycheck processes.
+
+
+**Method:** `rust-analyzer/clearFlycheck`
+
+**Notification:**
+
+```typescript
+interface ClearFlycheckParams {}
+```
+
+Clears the flycheck diagnostics.
+
+**Method:** `rust-analyzer/cancelFlycheck`
+
+**Notification:**
+
+```typescript
+interface CancelFlycheckParams {}
+```
+
+Cancels all running flycheck processes.
+
## Syntax Tree
**Method:** `rust-analyzer/syntaxTree`
@@ -753,3 +792,29 @@ export interface ClientCommandOptions {
commands: string[];
}
```
+
+## Colored Diagnostic Output
+
+**Experimental Client Capability:** `{ "colorDiagnosticOutput": boolean }`
+
+If this capability is set, the "full compiler diagnostics" provided by `checkOnSave`
+will include ANSI color and style codes to render the diagnostic in a similar manner
+as `cargo`. This is translated into `--message-format=json-diagnostic-rendered-ansi`
+when flycheck is run, instead of the default `--message-format=json`.
+
+The full compiler rendered diagnostics are included in the server response
+regardless of this capability:
+
+```typescript
+// https://microsoft.github.io/language-server-protocol/specifications/specification-current#diagnostic
+export interface Diagnostic {
+ ...
+ data?: {
+ /**
+ * The human-readable compiler output as it would be printed to a terminal.
+ * Includes ANSI color and style codes if the client has set the experimental
+ * `colorDiagnosticOutput` capability.
+ */
+ rendered?: string;
+ };
+}