summaryrefslogtreecommitdiff
path: root/lsp-parse.c
diff options
context:
space:
mode:
authorpommicket <pommicket@gmail.com>2023-01-03 18:01:04 -0500
committerpommicket <pommicket@gmail.com>2023-01-03 18:01:04 -0500
commitc0397f1f4c80e73a2e4ccd1946703fe6a5bb405e (patch)
tree5b95649c140083e2af4332bb92260842436f22c9 /lsp-parse.c
parent87c8bd6eb27edb4bfc539967235c3a1e2f8d77e4 (diff)
go to type definition
Diffstat (limited to 'lsp-parse.c')
-rw-r--r--lsp-parse.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/lsp-parse.c b/lsp-parse.c
index 9c22fe4..42f2291 100644
--- a/lsp-parse.c
+++ b/lsp-parse.c
@@ -151,23 +151,34 @@ static void parse_capabilities(LSP *lsp, const JSON *json, JSONObject capabiliti
arr_add(lsp->signature_help_retrigger_chars, '>');
}
- // check for hover support
+ // check for textDocument/hover support
JSONValue hover_value = json_object_get(json, capabilities, "hoverProvider");
if (hover_value.type != JSON_UNDEFINED && hover_value.type != JSON_FALSE) {
cap->hover_support = true;
}
- // check for definition support
+ // check for textDocument/definition support
JSONValue definition_value = json_object_get(json, capabilities, "definitionProvider");
if (definition_value.type != JSON_UNDEFINED && definition_value.type != JSON_FALSE) {
cap->definition_support = true;
}
- // check for declaration support
+ // check for textDocument/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/typeDefinition support
+ JSONValue type_definition_value = json_object_get(json, capabilities, "typeDefinitionProvider");
+ if (type_definition_value.type != JSON_UNDEFINED && type_definition_value.type != JSON_FALSE) {
+ cap->type_definition_support = true;
+ }
+
+ // check for textDocument/implementation support
+ JSONValue implementation_value = json_object_get(json, capabilities, "implementationProvider");
+ if (implementation_value.type != JSON_UNDEFINED && implementation_value.type != JSON_FALSE) {
+ cap->implementation_support = true;
+ }
// check for textDocument/documentHighlight support
JSONValue highlight_value = json_object_get(json, capabilities, "documentHighlightProvider");
@@ -890,6 +901,8 @@ void process_message(LSP *lsp, JSON *json) {
break;
case LSP_REQUEST_DEFINITION:
case LSP_REQUEST_DECLARATION:
+ case LSP_REQUEST_TYPE_DEFINITION:
+ case LSP_REQUEST_IMPLEMENTATION:
add_to_messages = parse_definition(lsp, json, &response);
break;
case LSP_REQUEST_HIGHLIGHT: