diff options
author | pommicket <pommicket@gmail.com> | 2023-08-04 19:35:48 -0400 |
---|---|---|
committer | pommicket <pommicket@gmail.com> | 2023-08-04 19:35:48 -0400 |
commit | 45d69107725a02cf6d912a571b771da3ef5abfbf (patch) | |
tree | 6b5d44104f57074dc00f1bab8eed986ca707b8a2 /lsp-write.c | |
parent | f278b832dc6e085d05b243bbae2af82e78e36d6d (diff) |
textDocument/documentLink parsing
Diffstat (limited to 'lsp-write.c')
-rw-r--r-- | lsp-write.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lsp-write.c b/lsp-write.c index df695a6..85c5781 100644 --- a/lsp-write.c +++ b/lsp-write.c @@ -288,6 +288,8 @@ static const char *lsp_request_method(LSPRequest *request) { return "textDocument/implementation"; case LSP_REQUEST_HIGHLIGHT: return "textDocument/documentHighlight"; + case LSP_REQUEST_DOCUMENT_LINK: + return "textDocument/documentLink"; case LSP_REQUEST_RENAME: return "textDocument/rename"; case LSP_REQUEST_WORKSPACE_FOLDERS: @@ -447,6 +449,11 @@ void write_request(LSP *lsp, LSPRequest *request) { write_key_obj_start(o, "definition"); // NOTE: LocationLink support doesn't seem useful to us right now. write_obj_end(o); + + // document link capabilities + write_key_obj_start(o, "documentLink"); + write_key_bool(o, "tooltipSupport", true); + write_obj_end(o); write_obj_end(o); write_key_obj_start(o, "workspace"); write_key_bool(o, "workspaceFolders", true); @@ -579,6 +586,14 @@ void write_request(LSP *lsp, LSPRequest *request) { write_obj_end(o); write_obj_end(o); } break; + case LSP_REQUEST_DOCUMENT_LINK: { + const LSPRequestDocumentLink *lnk = &request->data.document_link; + write_key_obj_start(o, "params"); + write_key_obj_start(o, "textDocument"); + write_key_file_uri(o, "uri", lnk->document); + 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"); |