diff options
author | pommicket <pommicket@gmail.com> | 2022-12-27 18:28:56 -0500 |
---|---|---|
committer | pommicket <pommicket@gmail.com> | 2022-12-27 18:28:56 -0500 |
commit | e112a90ff73f7f407ed2251f905565713c237bc1 (patch) | |
tree | fd2cca33161c807cbbf8b29d9a49e778bee5aca8 /main.c | |
parent | 1eaef3694d54d3d92f0b43304c72f5148b4e5db9 (diff) |
start signature help
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 25 |
1 files changed, 24 insertions, 1 deletions
@@ -5,6 +5,8 @@ - hover - go to definition using LSP - find usages +- go through signature help capabilities +- separate signature-help setting (dont use trigger-characters) - check if there are any other non-optional/nice-to-have-support-for server-to-client requests - do something with lsp->error - document lsp.h and lsp.c. @@ -138,6 +140,7 @@ bool tag_goto(Ted *ted, char const *tag); #include "tags.c" #include "menu.c" #include "autocomplete.c" +#include "signature-help.c" #include "command.c" #include "config.c" #include "session.c" @@ -768,13 +771,33 @@ int main(int argc, char **argv) { char32_t last_char = 0; unicode_utf8_to_utf32(&last_char, &text[last_code_point], strlen(text) - last_code_point); - arr_foreach_ptr(lsp->trigger_chars, char32_t, c) { + arr_foreach_ptr(lsp->completion_trigger_chars, char32_t, c) { if (*c == last_char) { autocomplete_open(ted, last_char); break; } } + bool signature_help = false; + arr_foreach_ptr(lsp->signature_help_trigger_chars, char32_t, c) { + if (*c == last_char) { + signature_help = true; + break; + } + } + + if (ted->signature_help.open) { + arr_foreach_ptr(lsp->signature_help_retrigger_chars, char32_t, c) { + if (*c == last_char) { + signature_help = true; + break; + } + } + } + + if (signature_help) + signature_help_open(ted, last_char); + if (settings->identifier_trigger_characters && is_word(last_char) && !is_digit(last_char)) autocomplete_open(ted, last_char); |