summaryrefslogtreecommitdiff
path: root/lsp-parse.c
diff options
context:
space:
mode:
authorpommicket <pommicket@gmail.com>2023-01-03 17:29:19 -0500
committerpommicket <pommicket@gmail.com>2023-01-03 17:29:19 -0500
commit87c8bd6eb27edb4bfc539967235c3a1e2f8d77e4 (patch)
tree4dbcb24ce4fca226e5b70bc5f01d71158d891426 /lsp-parse.c
parent0d92c03f3998fe4d16f3ba928d3a94583755e1ce (diff)
go to declaration
Diffstat (limited to 'lsp-parse.c')
-rw-r--r--lsp-parse.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/lsp-parse.c b/lsp-parse.c
index 14db651..9c22fe4 100644
--- a/lsp-parse.c
+++ b/lsp-parse.c
@@ -163,6 +163,12 @@ static void parse_capabilities(LSP *lsp, const JSON *json, JSONObject capabiliti
cap->definition_support = true;
}
+ // check for declaration support
+ JSONValue declaration_value = json_object_get(json, capabilities, "declarationProvider");
+ if (declaration_value.type != JSON_UNDEFINED && declaration_value.type != JSON_FALSE) {
+ cap->declaration_support = true;
+ }
+
// check for textDocument/documentHighlight support
JSONValue highlight_value = json_object_get(json, capabilities, "documentHighlightProvider");
if (highlight_value.type != JSON_UNDEFINED && highlight_value.type != JSON_FALSE) {
@@ -883,6 +889,7 @@ void process_message(LSP *lsp, JSON *json) {
add_to_messages = parse_hover(lsp, json, &response);
break;
case LSP_REQUEST_DEFINITION:
+ case LSP_REQUEST_DECLARATION:
add_to_messages = parse_definition(lsp, json, &response);
break;
case LSP_REQUEST_HIGHLIGHT: