summaryrefslogtreecommitdiff
path: root/lsp-parse.c
diff options
context:
space:
mode:
authorpommicket <pommicket@gmail.com>2022-12-23 00:18:07 -0500
committerpommicket <pommicket@gmail.com>2022-12-23 00:18:07 -0500
commit7f98e047cb791b84cc955f534a7e94395fed1ae0 (patch)
treeb295b9bdbd8ad4bcd88e7e73f025109d5b63af93 /lsp-parse.c
parentdaee4283b56603e172aac547c20c5534e588f60d (diff)
show documentation!
Diffstat (limited to 'lsp-parse.c')
-rw-r--r--lsp-parse.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/lsp-parse.c b/lsp-parse.c
index 9d02782..05fc898 100644
--- a/lsp-parse.c
+++ b/lsp-parse.c
@@ -181,6 +181,16 @@ static bool parse_completion(LSP *lsp, const JSON *json, LSPResponse *response)
documentation = json_object_get_string(json, documentation_value.val.object,
"value");
}
+ if (documentation.len) {
+ if (documentation.len > 1000) {
+ // rust has some docs which are *20,000* bytes long
+ // that's more than i'm ever gonna show on-screen!
+ documentation.len = 1000;
+ // okay this could break mid-code-point but whatever it would probably
+ // just display ⌷.
+ }
+ item->documentation = lsp_response_add_json_string(response, json, documentation);
+ }
JSONString detail_text = json_object_get_string(json, item_object, "detail");