From 0b5d6927b3467a8849fc450353d08b033fc19379 Mon Sep 17 00:00:00 2001 From: "Ethan \"Skye\" White" Date: Fri, 14 Nov 2025 19:58:41 -0500 Subject: [PATCH] kludge to fix multiple overloads Currently, when I'm using jdtls, if I have multiple overloads of the same method, only one will show up in the list. This is because the different overloads will all have the same label. This commit adds invisible characters to the ends of the labels, to make them unique. That's a hideous solution, but it does work. --- init.lua | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/init.lua b/init.lua index 7b38c3a..483a43d 100644 --- a/init.lua +++ b/init.lua @@ -1419,6 +1419,15 @@ function lsp.request_completion(doc, line, col, forced) desc = desc:gsub("[%s\n]+$", "") :gsub("\n\n\n+", "\n\n") + if lsp.servers[server.name].replace_label then + local chars = {"\u{0}", "\u{1}", "\u{2}", "\u{3}", "\u{4}", "\u{5}", "\u{6}", "\u{7}", "\u{8}", "\u{9}"} + local toAdd = "" + local symbolCountStr = tostring(symbol_count) + for i=1, #symbolCountStr do + toAdd = toAdd .. chars[tonumber(symbolCountStr:sub(i, i)) + 1] + end + label = label .. toAdd + end symbols.items[label] = { info = info, desc = desc,