summaryrefslogtreecommitdiff
path: root/lsp.c
diff options
context:
space:
mode:
authorpommicket <pommicket@gmail.com>2023-09-08 22:59:47 -0400
committerpommicket <pommicket@gmail.com>2023-09-08 22:59:47 -0400
commit0dcfd5a4f1fd865c24c01b17b214e1f72e4c06fe (patch)
treed693d70a57713cf4dbe48d30159100bab279c77d /lsp.c
parentf86b0aa1e843646056c08a91fcc759aa0d8a57ba (diff)
LSP code formatting (not entirely working yet)
Diffstat (limited to 'lsp.c')
-rw-r--r--lsp.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/lsp.c b/lsp.c
index 9d98b8c..0ab78a8 100644
--- a/lsp.c
+++ b/lsp.c
@@ -119,6 +119,8 @@ void lsp_request_free(LSPRequest *r) {
case LSP_REQUEST_DOCUMENT_LINK:
case LSP_REQUEST_CONFIGURATION:
case LSP_REQUEST_DID_OPEN:
+ case LSP_REQUEST_FORMATTING:
+ case LSP_REQUEST_RANGE_FORMATTING:
break;
case LSP_REQUEST_PUBLISH_DIAGNOSTICS: {
LSPRequestPublishDiagnostics *pub = &r->data.publish_diagnostics;
@@ -169,6 +171,9 @@ void lsp_response_free(LSPResponse *r) {
case LSP_REQUEST_DOCUMENT_LINK:
arr_free(r->data.document_link.links);
break;
+ case LSP_REQUEST_FORMATTING:
+ arr_free(r->data.formatting.edits);
+ break;
default:
break;
}
@@ -252,6 +257,10 @@ static bool lsp_supports_request(LSP *lsp, const LSPRequest *request) {
return cap->references_support;
case LSP_REQUEST_DOCUMENT_LINK:
return cap->document_link_support;
+ case LSP_REQUEST_FORMATTING:
+ return cap->formatting_support;
+ case LSP_REQUEST_RANGE_FORMATTING:
+ return cap->range_formatting_support;
}
assert(0);
return false;
@@ -293,6 +302,8 @@ static bool request_type_is_notification(LSPRequestType type) {
case LSP_REQUEST_WORKSPACE_SYMBOLS:
case LSP_REQUEST_WORKSPACE_FOLDERS:
case LSP_REQUEST_DOCUMENT_LINK:
+ case LSP_REQUEST_FORMATTING:
+ case LSP_REQUEST_RANGE_FORMATTING:
return false;
}
assert(0);