summaryrefslogtreecommitdiff
path: root/lsp.c
diff options
context:
space:
mode:
authorpommicket <pommicket@gmail.com>2022-12-30 11:38:00 -0500
committerpommicket <pommicket@gmail.com>2022-12-30 11:38:00 -0500
commit65cbe00bc124bdc1bd83bcd42ad5fbed521412b2 (patch)
tree7b4c617e427681fd58700ba0cc06286a38a90539 /lsp.c
parent4232df89b50754779814a97f374451fce2e36447 (diff)
parse workspace/symbol response
Diffstat (limited to 'lsp.c')
-rw-r--r--lsp.c50
1 files changed, 3 insertions, 47 deletions
diff --git a/lsp.c b/lsp.c
index 3efa830..c8de1a7 100644
--- a/lsp.c
+++ b/lsp.c
@@ -93,6 +93,9 @@ static void lsp_response_free(LSPResponse *r) {
case LSP_REQUEST_DEFINITION:
arr_free(r->data.definition.locations);
break;
+ case LSP_REQUEST_WORKSPACE_SYMBOLS:
+ arr_free(r->data.workspace_symbols.symbols);
+ break;
default:
break;
}
@@ -537,53 +540,6 @@ void lsp_document_changed(LSP *lsp, const char *document, LSPDocumentChangeEvent
lsp_send_request(lsp, &request);
}
-#if 0
-SymbolKind lsp_symbol_kind_to_ted(LSPSymbolKind kind) {
- switch (kind) {
- case LSP_SYMBOL_OTHER:
- case LSP_SYMBOL_FILE:
- case LSP_SYMBOL_MODULE:
- case LSB_SYMBOL_NAMESPACE:
- case LSP_SYMBOL_PACKAGE:
- return SYMBOL_OTHER;
-
- case LSP_SYMBOL_CLASS:
- case LSP_SYMBOL_TYPEPARAMETER:
- case LSP_SYMBOL_ENUM:
- case LSP_SYMBOL_INTERFACE:
- case LSP_SYMBOL_STRUCT:
- case LSP_SYMBOL_EVENT: // i have no clue what this is. let's say it's a type.
- return SYMBOL_TYPE;
-
- case LSP_SYMBOL_PROPERTY:
- case LSP_SYMBOL_FIELD:
- case LSP_SYMBOL_KEY:
- return SYMBOL_FIELD;
-
- case LSP_SYMBOL_CONSTRUCTOR:
- case LSP_SYMBOL_FUNCTION:
- case LSP_SYMBOL_OPERATOR:
- case LSP_SYMBOL_METHOD:
- return SYMBOL_FUNCTION;
-
- case LSP_SYMBOL_VARIABLE:
- return SYMBOL_VARIABLE;
-
- case LSP_SYMBOL_CONSTANT:
- case LSP_SYMBOL_STRING:
- case LSP_SYMBOL_NUMBER:
- case LSP_SYMBOL_BOOLEAN:
- case LSP_SYMBOL_ARRAY:
- case LSP_SYMBOL_OBJECT:
- case LSP_SYMBOL_ENUMMEMBER:
- case LSP_SYMBOL_NULL:
- return SYMBOL_CONSTANT;
- }
-
- return SYMBOL_OTHER;
-}
-#endif
-
bool lsp_position_eq(LSPPosition a, LSPPosition b) {
return a.line == b.line && a.character == b.character;
}