diff options
author | pommicket <pommicket@gmail.com> | 2022-12-25 15:58:30 -0500 |
---|---|---|
committer | pommicket <pommicket@gmail.com> | 2022-12-25 15:58:30 -0500 |
commit | 9ee67ef5097451705b4ae9cb28895f726843cdf3 (patch) | |
tree | 6342192680691acb9151938c06f699e876c17819 /ted.h | |
parent | f67094bce357a76334a717ed669b377d3b93d18e (diff) |
handle complete vs incomplete lists
Diffstat (limited to 'ted.h')
-rw-r--r-- | ted.h | 18 |
1 files changed, 14 insertions, 4 deletions
@@ -379,16 +379,26 @@ typedef struct { SymbolKind kind; } Autocompletion; +enum { + // autocomplete was triggered by :autocomplete command + TRIGGER_INVOKED = 0x12000, + // autocomplete list needs to be updated because more characters were typed + TRIGGER_INCOMPLETE = 0x12001, +}; + typedef struct { bool open; // is the autocomplete window open? bool waiting_for_lsp; + bool is_list_complete; // should the completions array be updated when more characters are typed? - // which trigger character invoked this (0 if autocomplete was manually invoked) - char32_t trigger_char; + // what trigger caused the last request for completions: + // either a character code (for trigger characters), + // or one of the TRIGGER_* constants above + uint32_t trigger; - // when autocomplete menu was opened + // when we sent the request to the LSP for completions // (this is used to figure out when we should display "Loading...") - struct timespec open_time; + struct timespec lsp_request_time; Autocompletion *completions; // dynamic array of all completions u32 *suggested; // dynamic array of completions to be suggested (indices into completions) |