diff options
author | pommicket <pommicket@gmail.com> | 2023-09-07 14:38:49 -0400 |
---|---|---|
committer | pommicket <pommicket@gmail.com> | 2023-09-07 14:38:49 -0400 |
commit | 815d652b570f53c989f62d0c7db847d7d6dfd940 (patch) | |
tree | c977583cfcc5b682a8cee5546bcf3c837014df1b /lsp.h | |
parent | bb4b7774aabc2686f936935b02899b1aa0bf1f2b (diff) |
textDocument/publishDiagnostics parsing
Diffstat (limited to 'lsp.h')
-rw-r--r-- | lsp.h | 26 |
1 files changed, 26 insertions, 0 deletions
@@ -94,6 +94,7 @@ typedef enum { LSP_REQUEST_SHOW_MESSAGE, //< window/showMessage and window/showMessageRequest LSP_REQUEST_LOG_MESSAGE, //< window/logMessage LSP_REQUEST_WORKSPACE_FOLDERS, //< workspace/workspaceFolders - NOTE: this is handled directly in lsp-parse.c (because it only needs information from the LSP struct) + LSP_REQUEST_PUBLISH_DIAGNOSTICS, //< textDocument/publishDiagnostics } LSPRequestType; typedef enum { @@ -148,6 +149,30 @@ typedef struct { LSPString message; } LSPRequestMessage; +typedef enum { +#define LSP_DIAGNOSTIC_SEVERITY_MIN 1 + LSP_DIAGNOSTIC_SEVERITY_ERROR = 1, + LSP_DIAGNOSTIC_SEVERITY_WARNING = 2, + LSP_DIAGNOSTIC_SEVERITY_INFORMATION = 3, + LSP_DIAGNOSTIC_SEVERITY_HINT = 4, +#define LSP_DIAGNOSTIC_SEVERITY_MAX 4 +} LSPDiagnosticSeverity; + +typedef struct { + LSPRange range; + LSPDiagnosticSeverity severity; + LSPString code; + LSPString message; + /// URI to description of code + /// e.g. for Rust's E0621, this would be https://doc.rust-lang.org/error_codes/E0621.html + LSPString code_description_uri; +} LSPDiagnostic; + +typedef struct { + LSPDocumentID document; + LSPDiagnostic *diagnostics; // dynamic array +} LSPRequestPublishDiagnostics; + /// these triggers are used for completion context and signature help context. #define LSP_TRIGGER_NONE 0 // not actually defined in LSP spec @@ -247,6 +272,7 @@ typedef struct { LSPRequestDidChangeWorkspaceFolders change_workspace_folders; LSPRequestRename rename; LSPRequestDocumentLink document_link; + LSPRequestPublishDiagnostics publish_diagnostics; } data; } LSPRequest; |