From 7a3b8e3fcec733367d020b1e913e1a88ba9f39b6 Mon Sep 17 00:00:00 2001 From: CJ van den Berg Date: Fri, 30 Jan 2026 14:37:13 +0100 Subject: [PATCH] fix: remove completion de-duplication Now that requests cannot overlap any duplicates are actually from the LSP. Deduplication was not working correctly for some LSPs so we just remove it now. --- src/tui/mode/overlay/completion_dropdown.zig | 7 ------- src/tui/mode/overlay/completion_palette.zig | 7 ------- 2 files changed, 14 deletions(-) diff --git a/src/tui/mode/overlay/completion_dropdown.zig b/src/tui/mode/overlay/completion_dropdown.zig index f2f6215..d91f6d0 100644 --- a/src/tui/mode/overlay/completion_dropdown.zig +++ b/src/tui/mode/overlay/completion_dropdown.zig @@ -52,9 +52,6 @@ pub fn load_entries(self: *Type) !usize { max_description = 0; var max_label_len: usize = 0; - var existing: std.StringHashMapUnmanaged(void) = .empty; - defer existing.deinit(self.allocator); - self.value.query = null; var iter: []const u8 = self.value.editor.completions.data.items; while (iter.len > 0) { @@ -62,10 +59,6 @@ pub fn load_entries(self: *Type) !usize { if (!try cbor.matchValue(&iter, cbor.extract_cbor(&cbor_item))) return error.BadCompletion; const values = get_values(cbor_item); - const dup_text = if (values.sort_text.len > 0) values.sort_text else values.label; - if (existing.contains(dup_text)) continue; - try existing.put(self.allocator, dup_text, {}); - if (self.value.query == null) if (get_query_selection(self.value.editor, values)) |query| { self.value.query = query; }; diff --git a/src/tui/mode/overlay/completion_palette.zig b/src/tui/mode/overlay/completion_palette.zig index 8addddf..57219fa 100644 --- a/src/tui/mode/overlay/completion_palette.zig +++ b/src/tui/mode/overlay/completion_palette.zig @@ -42,9 +42,6 @@ pub fn load_entries(palette: *Type) !usize { max_description = 0; var max_label_len: usize = 0; - var existing: std.StringHashMapUnmanaged(void) = .empty; - defer existing.deinit(palette.allocator); - const editor = tui.get_active_editor() orelse return error.NotFound; palette.value.start = editor.get_primary().*; var iter: []const u8 = editor.completions.data.items; @@ -53,10 +50,6 @@ pub fn load_entries(palette: *Type) !usize { if (!try cbor.matchValue(&iter, cbor.extract_cbor(&cbor_item))) return error.BadCompletion; const values = get_values(cbor_item); - const dup_text = if (values.sort_text.len > 0) values.sort_text else values.label; - if (existing.contains(dup_text)) continue; - try existing.put(palette.allocator, dup_text, {}); - if (palette.value.query == null) if (get_query_selection(editor, values)) |query| { palette.value.query = query; };