Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keep typing after the 1st tab when completing imports #1510

Merged
merged 1 commit into from
Jul 20, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,9 @@ private void appendReplacementString(StringBuilder buffer, CompletionProposal pr
String str = proposal.getKind() == CompletionProposal.TYPE_REF ? computeJavaTypeReplacementString(proposal) : String.valueOf(proposal.getCompletion());
if (client.isCompletionSnippetsSupported()) {
str = CompletionUtils.sanitizeCompletion(str);
if (proposal.getKind() == CompletionProposal.PACKAGE_REF && str != null && str.endsWith(".*;")) {
str = str.replace(".*;", ".${0:*};");
fbricon marked this conversation as resolved.
Show resolved Hide resolved
}
}
buffer.append(str);
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ public void testCompletion_import_package() throws JavaModelException{
assertNotNull(item.getTextEdit());
TextEdit te = item.getTextEdit();
assertNotNull(te);
assertEquals("java.sql.*;",te.getNewText());
assertEquals("java.sql.${0:*};", te.getNewText());
assertNotNull(te.getRange());
Range range = te.getRange();
assertEquals(0, range.getStart().getLine());
Expand Down