diff options
author | pommicket <pommicket@gmail.com> | 2025-09-30 10:42:13 -0400 |
---|---|---|
committer | pommicket <pommicket@gmail.com> | 2025-09-30 10:42:13 -0400 |
commit | 3a1af93e9c0f983da64070d3774596844c2a26e1 (patch) | |
tree | 65878feb922fcec4ae9f3cae4bbc1a5ee99d6cb9 /lsp.h | |
parent | 84da626a18ccc779aef4a178ee0097a93c959520 (diff) |
Initial implementation of code actions
Diffstat (limited to 'lsp.h')
-rw-r--r-- | lsp.h | 20 |
1 files changed, 18 insertions, 2 deletions
@@ -576,6 +576,20 @@ typedef struct { } LSPResponseFormatting; typedef struct { + int type; +} LSPCommand; + +typedef struct { + LSPString name; + LSPWorkspaceEdit edit; + LSPCommand command; +} LSPCodeAction; + +typedef struct { + LSPCodeAction *actions; +} LSPResponseCodeAction; + +typedef struct { LSPMessageBase base; /// the request which this is a response to LSPRequest request; @@ -596,6 +610,7 @@ typedef struct { LSPResponseDocumentLink document_link; /// `LSP_REQUEST_FORMATTING` or `LSP_REQUEST_RANGE_FORMATTING` LSPResponseFormatting formatting; + LSPResponseCodeAction code_action; } data; } LSPResponse; @@ -680,6 +695,7 @@ void lsp_register_language(u64 id, const char *lsp_identifier); // if clear = true, the error will be cleared. // you can set error = NULL, error_size = 0, clear = true to just clear the error bool lsp_get_error(LSP *lsp, char *error, size_t error_size, bool clear); +void lsp_response_free(LSPResponse *response); void lsp_message_free(LSPMessage *message); u32 lsp_document_id(LSP *lsp, const char *path); // returned pointer lives as long as lsp. @@ -952,8 +968,8 @@ void lsp_write_quit(void); char *json_reserialize(const JSON *json, JSONValue value); /// print server-to-client communication -#define LSP_SHOW_S2C 1 +#define LSP_SHOW_S2C 0 /// print client-to-server communication -#define LSP_SHOW_C2S 1 +#define LSP_SHOW_C2S 0 #endif // LSP_INTERNAL |