From 4c20da2934d11dfda9aa080956869d8e6139df4f Mon Sep 17 00:00:00 2001 From: Frederik Claus Date: Mon, 27 Sep 2021 15:42:23 +0200 Subject: [PATCH] Moves comment Signed-off-by: Frederik Claus --- .../internal/contentassist/CompletionProposalRequestor.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/contentassist/CompletionProposalRequestor.java b/org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/contentassist/CompletionProposalRequestor.java index f42e0d9be9..9f68be0dd1 100644 --- a/org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/contentassist/CompletionProposalRequestor.java +++ b/org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/contentassist/CompletionProposalRequestor.java @@ -232,13 +232,13 @@ public CompletionItem toCompletionItem(CompletionProposal proposal, int index) { this.descriptionProvider.updateDescription(proposal, $); $.setSortText(SortTextHelper.computeSortText(proposal)); proposalProvider.updateReplacement(proposal, $, '\0'); - // Make sure `filterText` matches `textEdit` - // See https://github.com/eclipse/eclipse.jdt.ls/issues/1348 boolean isSignatureHelpEnabled = preferenceManager.getPreferences().isSignatureHelpEnabled(); // Hide completions when signature help is visible. if (isSignatureHelpEnabled && PREFER_SIGNATURE_HELP_COMPLETION_ITEMS.contains(proposal.getKind())) { $.setFilterText(new String(proposal.getName())); } + // Make sure `filterText` matches `textEdit` + // See https://github.com/eclipse/eclipse.jdt.ls/issues/1348 if ($.getFilterText() == null && $.getTextEdit() != null) { String newText = $.getTextEdit().isLeft() ? $.getTextEdit().getLeft().getNewText() : $.getTextEdit().getRight().getNewText(); Range range = $.getTextEdit().isLeft() ? $.getTextEdit().getLeft().getRange() : ($.getTextEdit().getRight().getInsert() != null ? $.getTextEdit().getRight().getInsert() : $.getTextEdit().getRight().getReplace());