summaryrefslogtreecommitdiff
path: root/lsp.c
diff options
context:
space:
mode:
authorpommicket <pommicket@gmail.com>2022-12-30 22:31:37 -0500
committerpommicket <pommicket@gmail.com>2022-12-30 22:31:37 -0500
commit37275ad25635624161c3b51bc81cbd431a200e0c (patch)
tree14177e8326c4b384ddfc3a60f72e07f0becfe378 /lsp.c
parent94ce74b998ad019e2307e4b69f006127dba775e2 (diff)
textDocument/references request
Diffstat (limited to 'lsp.c')
-rw-r--r--lsp.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/lsp.c b/lsp.c
index 23b1023..81cb4c9 100644
--- a/lsp.c
+++ b/lsp.c
@@ -52,6 +52,7 @@ static void lsp_request_free(LSPRequest *r) {
case LSP_REQUEST_SIGNATURE_HELP:
case LSP_REQUEST_HOVER:
case LSP_REQUEST_DEFINITION:
+ case LSP_REQUEST_REFERENCES:
case LSP_REQUEST_HIGHLIGHT:
case LSP_REQUEST_DID_CLOSE:
case LSP_REQUEST_WORKSPACE_FOLDERS:
@@ -107,6 +108,9 @@ static void lsp_response_free(LSPResponse *r) {
case LSP_REQUEST_HIGHLIGHT:
arr_free(r->data.highlight.highlights);
break;
+ case LSP_REQUEST_REFERENCES:
+ arr_free(r->data.references.locations);
+ break;
default:
break;
}
@@ -182,6 +186,8 @@ static bool lsp_supports_request(LSP *lsp, const LSPRequest *request) {
return cap->rename_support;
case LSP_REQUEST_HIGHLIGHT:
return cap->highlight_support;
+ case LSP_REQUEST_REFERENCES:
+ return cap->references_support;
}
assert(0);
return false;
@@ -214,6 +220,7 @@ static bool request_type_is_notification(LSPRequestType type) {
case LSP_REQUEST_SIGNATURE_HELP:
case LSP_REQUEST_HOVER:
case LSP_REQUEST_DEFINITION:
+ case LSP_REQUEST_REFERENCES:
case LSP_REQUEST_RENAME:
case LSP_REQUEST_WORKSPACE_SYMBOLS:
case LSP_REQUEST_WORKSPACE_FOLDERS: