summaryrefslogtreecommitdiff
path: root/lsp-write.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-write.c
parent94ce74b998ad019e2307e4b69f006127dba775e2 (diff)
textDocument/references request
Diffstat (limited to 'lsp-write.c')
-rw-r--r--lsp-write.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/lsp-write.c b/lsp-write.c
index 3255ec0..3c2c11a 100644
--- a/lsp-write.c
+++ b/lsp-write.c
@@ -271,6 +271,8 @@ static const char *lsp_request_method(LSPRequest *request) {
return "textDocument/signatureHelp";
case LSP_REQUEST_HOVER:
return "textDocument/hover";
+ case LSP_REQUEST_REFERENCES:
+ return "textDocument/references";
case LSP_REQUEST_DEFINITION:
return "textDocument/definition";
case LSP_REQUEST_HIGHLIGHT:
@@ -552,6 +554,19 @@ static void write_request(LSP *lsp, LSPRequest *request) {
write_document_position(o, hl->position);
write_obj_end(o);
} break;
+ case LSP_REQUEST_REFERENCES: {
+ const LSPRequestReferences *refs = &request->data.references;
+ write_key_obj_start(o, "params");
+ write_document_position(o, refs->position);
+ write_key_obj_start(o, "context");
+ // why is this includeDeclaration thing which has nothing to do with context
+ // why is it in an object called context
+ // there's no other members of the ReferenceContext interface. just this.
+ // why, LSP, why
+ write_key_bool(o, "includeDeclaration", refs->include_declaration);
+ write_obj_end(o);
+ write_obj_end(o);
+ } break;
case LSP_REQUEST_RENAME: {
const LSPRequestRename *rename = &request->data.rename;
write_key_obj_start(o, "params");