diff --git a/java/src/processing/mode/java/lsp/PdeAdapter.java b/java/src/processing/mode/java/lsp/PdeAdapter.java index 1cd2f6ef3..b2fabe483 100644 --- a/java/src/processing/mode/java/lsp/PdeAdapter.java +++ b/java/src/processing/mode/java/lsp/PdeAdapter.java @@ -318,11 +318,15 @@ CompletionItem convertCompletionCandidate(CompletionCandidate c) { for (char ch : chs) { if (ch == ',') { n += 1; - //insert += ",$" + n; - newInsert.append(",$").append(n); + /* + Append the comma and the LSP tabstop identifier, + then skip appending the duplicate 'ch' character + */ + newInsert.append(", $").append(n); + } else { + //Only append the original character if it wasn't a comma + newInsert.append(ch); } - //insert += ch; - newInsert.append(ch); } insert = newInsert.toString(); }