summaryrefslogtreecommitdiff
path: root/lsp.h
diff options
context:
space:
mode:
Diffstat (limited to 'lsp.h')
-rw-r--r--lsp.h28
1 files changed, 13 insertions, 15 deletions
diff --git a/lsp.h b/lsp.h
index 0b25091..389f38e 100644
--- a/lsp.h
+++ b/lsp.h
@@ -1,6 +1,17 @@
typedef u32 LSPDocumentID;
typedef u32 LSPID;
+typedef struct {
+ u32 line;
+ // NOTE: this is the UTF-16 character index!
+ u32 character;
+} LSPPosition;
+
+typedef struct {
+ LSPDocumentID document;
+ LSPPosition pos;
+} LSPDocumentPosition;
+
typedef enum {
LSP_REQUEST,
LSP_RESPONSE
@@ -11,12 +22,6 @@ typedef struct {
} LSPString;
typedef struct {
- u32 line;
- // NOTE: this is the UTF-16 character index!
- u32 character;
-} LSPPosition;
-
-typedef struct {
LSPPosition start;
LSPPosition end;
} LSPRange;
@@ -83,11 +88,6 @@ typedef struct {
char *message;
} LSPRequestMessage;
-typedef struct {
- LSPDocumentID document;
- LSPPosition pos;
-} LSPDocumentPosition;
-
// these triggers are used for completion context and signature help context.
#define LSP_TRIGGER_NONE 0 // not actually defined in LSP spec
@@ -375,8 +375,6 @@ typedef struct LSP {
char error[256];
} LSP;
-// @TODO: function declarations
-
// returns true if there's an error.
// returns false and sets error to "" if there's no error.
// if clear = true, the error will be cleared.
@@ -401,7 +399,7 @@ LSP *lsp_create(const char *root_dir, Language language, const char *analyzer_co
// with root directory `new_root_dir`.
bool lsp_try_add_root_dir(LSP *lsp, const char *new_root_dir);
bool lsp_next_message(LSP *lsp, LSPMessage *message);
+bool lsp_position_eq(LSPPosition a, LSPPosition b);
+bool lsp_document_position_eq(LSPDocumentPosition a, LSPDocumentPosition b);
void lsp_document_changed(LSP *lsp, const char *document, LSPDocumentChangeEvent change);
void lsp_free(LSP *lsp);
-SymbolKind lsp_symbol_kind_to_ted(LSPSymbolKind kind);
-SymbolKind lsp_completion_kind_to_ted(LSPCompletionKind kind);