Skip to content

Commit

Permalink
Keep typing after the 1st tab when completing imports
Browse files Browse the repository at this point in the history
Signed-off-by: Snjezana Peco <[email protected]>
  • Loading branch information
snjeza authored and fbricon committed Jul 20, 2020
1 parent f64a7e7 commit 10c31a8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
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:*};");
}
}
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

0 comments on commit 10c31a8

Please sign in to comment.