summaryrefslogtreecommitdiff
path: root/autocomplete.c
diff options
context:
space:
mode:
authorpommicket <pommicket@gmail.com>2022-12-22 21:23:54 -0500
committerpommicket <pommicket@gmail.com>2022-12-22 21:23:54 -0500
commitc58f2247a9f9aaea86e461c176e4757e4d17292f (patch)
treeed453ed66b5e576c0029539faa0982c6c26cf31a /autocomplete.c
parent91ff61cc22c08e2c247b6b689561e6d18cf276e7 (diff)
symbol kind
Diffstat (limited to 'autocomplete.c')
-rw-r--r--autocomplete.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/autocomplete.c b/autocomplete.c
index eb5993f..24ca71b 100644
--- a/autocomplete.c
+++ b/autocomplete.c
@@ -144,6 +144,7 @@ static void autocomplete_process_lsp_response(Ted *ted, const LSPResponse *respo
ted_completion->text = str_dup(lsp_response_string(response, lsp_completion->text_edit.new_text));
const char *detail = lsp_response_string(response, lsp_completion->detail);
ted_completion->detail = *detail ? str_dup(detail) : NULL;
+ ted_completion->kind = lsp_completion_kind_to_ted(lsp_completion->kind);
}
}
autocomplete_update_suggested(ted);
@@ -282,7 +283,11 @@ static void autocomplete_frame(Ted *ted) {
} else {
for (size_t i = 0; i < ncompletions; ++i) {
state.x = x + padding; state.y = y;
+
+ ColorSetting label_color = color_for_symbol_kind(completions[i].kind);
+ rgba_u32_to_floats(colors[label_color], state.color);
text_utf8_with_state(font, &state, completions[i].label);
+
const char *detail = completions[i].detail;
if (detail) {
double label_end_x = state.x;