summaryrefslogtreecommitdiff
path: root/ted.h
diff options
context:
space:
mode:
authorpommicket <pommicket@gmail.com>2022-12-20 15:43:24 -0500
committerpommicket <pommicket@gmail.com>2022-12-20 15:43:24 -0500
commitd3375f02cfed99ed40c28631e62654af23817729 (patch)
tree575072b13497c3e2f6ba73f3d9feb90214ad6c70 /ted.h
parent9dc4d70511862004661cd5b0c02adc500c35f42e (diff)
start completion requests
Diffstat (limited to 'ted.h')
-rw-r--r--ted.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/ted.h b/ted.h
index 3d2bbc6..df50f8b 100644
--- a/ted.h
+++ b/ted.h
@@ -352,6 +352,11 @@ typedef struct {
u32 build_output_line; // which line in the build output corresponds to this error
} BuildError;
+typedef struct {
+ char *label;
+ char *text;
+} Autocompletion;
+
typedef struct Ted {
struct LSP *test_lsp; // @TODO: something better
@@ -405,6 +410,8 @@ typedef struct Ted {
bool building; // is the build process running?
bool autocomplete; // is the autocomplete window open?
+ Autocompletion *autocompletions; // dynamic array of suggestions
+ BufferPos autocomplete_pos; // position of cursor last time completions were generated. if this changes, we need to recompute completions.
i32 autocomplete_cursor; // which completion is currently selected
Rect autocomplete_rect; // rectangle where the autocomplete menu is (needed to avoid interpreting autocomplete clicks as other clicks)
@@ -468,6 +475,7 @@ typedef struct Ted {
char error_shown[512]; // error display in box on screen
} Ted;
+void autocomplete_close(Ted *ted);
void command_execute(Ted *ted, Command c, i64 argument);
void ted_switch_to_buffer(Ted *ted, TextBuffer *buffer);
// the settings of the active buffer, or the default settings if there is no active buffer