Skip to content

Commit 406cd23

Browse files
author
Maria Solano
committed
add markup diagnostic message spec
1 parent fbb32f4 commit 406cd23

File tree

4 files changed

+41
-1
lines changed

4 files changed

+41
-1
lines changed

_specifications/lsp/3.18/general/initialize.md

+22
Original file line numberDiff line numberDiff line change
@@ -885,6 +885,28 @@ interface ServerCapabilities {
885885
*/
886886
inlineCompletionProvider?: boolean | InlineCompletionOptions;
887887

888+
/**
889+
* Text document specific server capabilities.
890+
*
891+
* @since 3.18.0
892+
*/
893+
textDocument?: {
894+
/**
895+
* Capabilities specific to the diagnostic pull model.
896+
*
897+
* @since 3.18.0
898+
*/
899+
diagnostic?: {
900+
/**
901+
* Whether the server supports `MarkupContent` in diagnostic messages.
902+
*
903+
* @since 3.18.0
904+
* @proposed
905+
*/
906+
markupMessageSupport?: boolean;
907+
};
908+
};
909+
888910
/**
889911
* Workspace specific server capabilities
890912
*/

_specifications/lsp/3.18/language/codeAction.md

+3
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,9 @@ export interface CodeActionContext {
361361
* for the given range. There is no guarantee that these accurately reflect
362362
* the error state of the resource. The primary parameter
363363
* to compute code actions is the provided range.
364+
*
365+
* Note that the client should check the `textDocument.diagnostic.markupMessageSupport`
366+
* server capability before sending diagnostics with markup messages to a server.
364367
*/
365368
diagnostics: Diagnostic[];
366369

_specifications/lsp/3.18/language/pullDiagnostics.md

+8
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,14 @@ export interface DiagnosticClientCapabilities {
3030
* pulls.
3131
*/
3232
relatedDocumentSupport?: boolean;
33+
34+
/**
35+
* Whether the client supports `MarkupContent` in diagnostic messages.
36+
*
37+
* @since 3.18.0
38+
* @proposed
39+
*/
40+
markupMessageSupport?: boolean;
3341
}
3442
```
3543

_specifications/lsp/3.18/types/diagnostic.md

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
#### <a href="#diagnostic" name="diagnostic" class="anchor"> Diagnostic </a>
22

3+
- New in version 3.18: support for markup content in diagnostic messages. The support is guarded by the
4+
client capability `textDocument.diagnostic.markupMessageSupport`. If a client doesn't signal the capability,
5+
servers shouldn't send `MarkupContent` diagnostic messages back to the client.
6+
37
Represents a diagnostic, such as a compiler error or warning. Diagnostic objects are only valid in the scope of a resource.
48

59
```typescript
@@ -35,8 +39,11 @@ export interface Diagnostic {
3539

3640
/**
3741
* The diagnostic's message.
42+
*
43+
* @since 3.18.0 - support for MarkupContent. This is guarded by the client
44+
* capability `textDocument.diagnostic.markupMessageSupport`.
3845
*/
39-
message: string;
46+
message: string | MarkupContent;
4047

4148
/**
4249
* Additional metadata about the diagnostic.

0 commit comments

Comments
 (0)