In the upcoming 3.18 specs, the client can declare support for textDocument.diagnostic.markupMessageSupport and then the diagnostics message can be of type MarkupContent:
|
/** |
|
* The diagnostic's message. |
|
* |
|
* @since 3.18.0 - support for MarkupContent. This is guarded by the client |
|
* capability `textDocument.diagnostic.markupMessageSupport`. |
|
*/ |
|
message: string | MarkupContent; |
But the type definition from the metaModel.json file doesn't reflect that:
|
{ |
|
"name": "message", |
|
"type": { |
|
"kind": "base", |
|
"name": "string" |
|
}, |
|
"documentation": "The diagnostic's message. It usually appears in the user interface" |
|
}, |
Note that support for MarkupContent was initially added to the metaModel.json file in df7c77b on 2024-03-19.
But then it was later reverted/overwritten (accidentally?) in 7e1b69d on 2024-08-05.
Another thing that seems a bit inconsistent to me is that the client can declare markupMessageSupport only for pull diagnostics (via textDocument.diagnostic.markupMessageSupport in DiagnosticClientCapabilities), but not for the publishDiagnostics notifications (via textDocument.publishDiagnostics in PublishDiagnosticsClientCapabilities). But perhaps that is intentional, if publishDiagnostics notifications should be discouraged in favor of the newer pull diagnostics model?
In the upcoming 3.18 specs, the client can declare support for
textDocument.diagnostic.markupMessageSupportand then the diagnostics message can be of typeMarkupContent:language-server-protocol/_specifications/lsp/3.18/types/diagnostic.md
Lines 42 to 48 in da32ac0
But the type definition from the
metaModel.jsonfile doesn't reflect that:language-server-protocol/_specifications/lsp/3.18/metaModel/metaModel.json
Lines 9159 to 9166 in da32ac0
Note that support for
MarkupContentwas initially added to themetaModel.jsonfile in df7c77b on 2024-03-19.But then it was later reverted/overwritten (accidentally?) in 7e1b69d on 2024-08-05.
Another thing that seems a bit inconsistent to me is that the client can declare
markupMessageSupportonly for pull diagnostics (viatextDocument.diagnostic.markupMessageSupportin DiagnosticClientCapabilities), but not for the publishDiagnostics notifications (viatextDocument.publishDiagnosticsin PublishDiagnosticsClientCapabilities). But perhaps that is intentional, if publishDiagnostics notifications should be discouraged in favor of the newer pull diagnostics model?