From fb6f115f7c639c7b4bb00b506ee339607e03485a Mon Sep 17 00:00:00 2001 From: Robby Bennett Date: Thu, 12 Oct 2023 11:08:55 -0600 Subject: [PATCH] add method textDocument/publishDiagnosticLongDescriptions and add type DiagnosticLongDescription --- _data/linkableTypes.yml | 8 +++++- .../lsp/3.18/language/publishDiagnostics.md | 21 +++++++++++++++ _specifications/lsp/3.18/types/diagnostic.md | 26 ++++++++++++++++++- 3 files changed, 53 insertions(+), 2 deletions(-) diff --git a/_data/linkableTypes.yml b/_data/linkableTypes.yml index 729d0ce71..39adc04bb 100644 --- a/_data/linkableTypes.yml +++ b/_data/linkableTypes.yml @@ -68,6 +68,8 @@ link: '#diagnosticRelatedInformation' - type: 'CodeDescription' link: '#codeDescription' + - type: 'DiagnosticLongDescription' + link: '#diagnosticLongDescription' - type: 'Command' link: '#command' - type: 'TextEdit' @@ -342,6 +344,10 @@ link: '#publishDiagnosticsClientCapabilities' - type: 'PublishDiagnosticsParams' link: '#publishDiagnosticsParams' + - type: 'textDocument/publishDiagnosticLongDescriptions' + link: '#textDocument_publishDiagnosticLongDescriptions' + - type: 'PublishDiagnosticLongDescriptionsParams' + link: '#publishDiagnosticLongDescriptionsParams' - type: 'textDocument/completion' link: '#textDocument_completion' - type: 'CompletionClientCapabilities' @@ -895,4 +901,4 @@ - type: 'InlineCompletionList' link: '#inlineCompletionList' - type: 'InlineCompletionItem' - link: '#inlineCompletionItem' \ No newline at end of file + link: '#inlineCompletionItem' diff --git a/_specifications/lsp/3.18/language/publishDiagnostics.md b/_specifications/lsp/3.18/language/publishDiagnostics.md index 01f30bd1d..cba4e7d8b 100644 --- a/_specifications/lsp/3.18/language/publishDiagnostics.md +++ b/_specifications/lsp/3.18/language/publishDiagnostics.md @@ -90,3 +90,24 @@ interface PublishDiagnosticsParams { diagnostics: Diagnostic[]; } ``` + +#### PublishDiagnosticLongDescriptions Notification (:arrow_left:) + +Diagnostic long descriptions notifications are sent from the server to the client to provide static descriptions of a particular diagnostic code. + +These notifications can be sent before or after the `textDocument/publishDiagnostics` notifications. + +_Notification_: +* method: `textDocument/publishDiagnosticLongDescriptions` +* params: `PublishDiagnosticLongDescriptionsParams` defined as follows: + +
+ +```typescript +interface PublishDiagnosticLongDescriptionsParams { + /** + * An array of diagnostic long description items. + */ + diagnosticLongDescriptions: DiagnosticLongDescription[]; +} +``` diff --git a/_specifications/lsp/3.18/types/diagnostic.md b/_specifications/lsp/3.18/types/diagnostic.md index 6c40d0958..9e6b76c62 100644 --- a/_specifications/lsp/3.18/types/diagnostic.md +++ b/_specifications/lsp/3.18/types/diagnostic.md @@ -155,4 +155,28 @@ export interface CodeDescription { */ href: URI; } -``` \ No newline at end of file +``` + +`DiagnosticLongDescription` is defined as follows: + +
+ +```typescript +/** + * Structure to capture a static long description for a diagnostic error. + * + * @since 3.18.0 + */ +export interface DiagnosticLongDescription { + /** + * The diagnostic's code. + */ + code?: integer | string; + + /** + * The content with more information about the diagnostic error (e.g. + * multiple paragraphs, code examples, exceptions, links to sources). + */ + description: string | MarkupContent; +} +```