summaryrefslogtreecommitdiff
path: root/lsp-parse.c
diff options
context:
space:
mode:
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: