diff options
author | pommicket <pommicket@gmail.com> | 2022-12-23 14:48:32 -0500 |
---|---|---|
committer | pommicket <pommicket@gmail.com> | 2022-12-23 14:48:32 -0500 |
commit | dbab768e4d0be378e65399f32f26edb4756533ce (patch) | |
tree | 7cd92c46903df99c1c3ad084d2eab0013f67c4ab /lsp-write.c | |
parent | 002215c37f6a1ced083c78b7c9b6f86f472b23cd (diff) |
completion context + don't flash cursor if trigger character
Diffstat (limited to 'lsp-write.c')
-rw-r--r-- | lsp-write.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lsp-write.c b/lsp-write.c index 87cb238..808f479 100644 --- a/lsp-write.c +++ b/lsp-write.c @@ -323,6 +323,7 @@ static void write_request(LSP *lsp, LSPRequest *request) { } write_arr_end(o); write_obj_end(o); + write_key_bool(o, "contextSupport", true); write_obj_end(o); write_obj_end(o); write_obj_end(o); @@ -383,6 +384,15 @@ static void write_request(LSP *lsp, LSPRequest *request) { write_key_file_uri(o, "uri", completion->position.document); write_obj_end(o); write_key_position(o, "position", completion->position.pos); + const LSPCompletionContext *context = &completion->context; + LSPCompletionTriggerKind trigger_kind = context->trigger_kind; + if (trigger_kind != LSP_TRIGGER_NONE) { + write_key_obj_start(o, "context"); + write_key_number(o, "triggerKind", trigger_kind); + if (trigger_kind == LSP_TRIGGER_CHARACTER) + write_key_string(o, "triggerCharacter", context->trigger_character); + write_obj_end(o); + } write_obj_end(o); } break; } |