diff options
author | pommicket <pommicket@gmail.com> | 2022-12-29 12:12:36 -0500 |
---|---|---|
committer | pommicket <pommicket@gmail.com> | 2022-12-29 12:12:36 -0500 |
commit | 18fbb21e6b95139a8890ba4a65f4402df128ac84 (patch) | |
tree | e72f8f462465d14bf48a88372f90d2d347f025c9 /lsp.c | |
parent | 948decc409bac1e3671afc5d0212b4b35c669b4a (diff) |
working hover
Diffstat (limited to 'lsp.c')
-rw-r--r-- | lsp.c | 49 |
1 files changed, 8 insertions, 41 deletions
@@ -477,6 +477,7 @@ 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: @@ -521,48 +522,14 @@ SymbolKind lsp_symbol_kind_to_ted(LSPSymbolKind kind) { return SYMBOL_OTHER; } +#endif -SymbolKind lsp_completion_kind_to_ted(LSPCompletionKind kind) { - switch (kind) { - case LSP_COMPLETION_TEXT: - case LSP_COMPLETION_MODULE: - case LSP_COMPLETION_UNIT: - case LSP_COMPLETION_COLOR: - case LSP_COMPLETION_FILE: - case LSP_COMPLETION_REFERENCE: - case LSP_COMPLETION_FOLDER: - case LSP_COMPLETION_OPERATOR: - return SYMBOL_OTHER; - - case LSP_COMPLETION_METHOD: - case LSP_COMPLETION_FUNCTION: - case LSP_COMPLETION_CONSTRUCTOR: - return SYMBOL_FUNCTION; - - case LSP_COMPLETION_FIELD: - case LSP_COMPLETION_PROPERTY: - return SYMBOL_FIELD; - - case LSP_COMPLETION_VARIABLE: - return SYMBOL_VARIABLE; - - case LSP_COMPLETION_CLASS: - case LSP_COMPLETION_INTERFACE: - case LSP_COMPLETION_ENUM: - case LSP_COMPLETION_STRUCT: - case LSP_COMPLETION_EVENT: - case LSP_COMPLETION_TYPEPARAMETER: - return SYMBOL_TYPE; - - case LSP_COMPLETION_VALUE: - case LSP_COMPLETION_ENUMMEMBER: - case LSP_COMPLETION_CONSTANT: - return SYMBOL_CONSTANT; - - case LSP_COMPLETION_KEYWORD: - case LSP_COMPLETION_SNIPPET: - return SYMBOL_KEYWORD; - } +bool lsp_position_eq(LSPPosition a, LSPPosition b) { + return a.line == b.line && a.character == b.character; +} + +bool lsp_document_position_eq(LSPDocumentPosition a, LSPDocumentPosition b) { + return a.document == b.document && lsp_position_eq(a.pos, b.pos); } #undef write_bool |