about summary refs log tree commit diff
diff options
context:
space:
mode:
authorIan Chamberlain <ichamberlain@juniper.net>2023-01-09 11:44:38 -0500
committerIan Chamberlain <ichamberlain@juniper.net>2023-01-09 11:50:37 -0500
commit283dfc45dd8fb1e6bbe78c8b2e90cb5d543f2f06 (patch)
treec55fc1d7b528679b40aa5cd0abd3cd905ee81715
parent65cf7abbe2ee75cce74592fa0af75356181566be (diff)
downloadrust-283dfc45dd8fb1e6bbe78c8b2e90cb5d543f2f06.tar.gz
rust-283dfc45dd8fb1e6bbe78c8b2e90cb5d543f2f06.zip
Add docs for `colorDiagnosticOutput` capability
-rw-r--r--docs/dev/lsp-extensions.md26
1 files changed, 26 insertions, 0 deletions
diff --git a/docs/dev/lsp-extensions.md b/docs/dev/lsp-extensions.md
index 1bbb4c2323c..a4780af1a26 100644
--- a/docs/dev/lsp-extensions.md
+++ b/docs/dev/lsp-extensions.md
@@ -792,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;
+    };
+}