Skip to content

Commit 283dfc4

Browse files
Add docs for colorDiagnosticOutput capability
1 parent 65cf7ab commit 283dfc4

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

docs/dev/lsp-extensions.md

+26
Original file line numberDiff line numberDiff line change
@@ -792,3 +792,29 @@ export interface ClientCommandOptions {
792792
commands: string[];
793793
}
794794
```
795+
796+
## Colored Diagnostic Output
797+
798+
**Experimental Client Capability:** `{ "colorDiagnosticOutput": boolean }`
799+
800+
If this capability is set, the "full compiler diagnostics" provided by `checkOnSave`
801+
will include ANSI color and style codes to render the diagnostic in a similar manner
802+
as `cargo`. This is translated into `--message-format=json-diagnostic-rendered-ansi`
803+
when flycheck is run, instead of the default `--message-format=json`.
804+
805+
The full compiler rendered diagnostics are included in the server response
806+
regardless of this capability:
807+
808+
```typescript
809+
// https://microsoft.github.io/language-server-protocol/specifications/specification-current#diagnostic
810+
export interface Diagnostic {
811+
...
812+
data?: {
813+
/**
814+
* The human-readable compiler output as it would be printed to a terminal.
815+
* Includes ANSI color and style codes if the client has set the experimental
816+
* `colorDiagnosticOutput` capability.
817+
*/
818+
rendered?: string;
819+
};
820+
}

0 commit comments

Comments
 (0)