dbalek commented on a change in pull request #3333:
URL: https://github.com/apache/netbeans/pull/3333#discussion_r758122346
##########
File path:
enterprise/micronaut/src/org/netbeans/modules/micronaut/completion/MicronautDataCompletionProvider.java
##########
@@ -51,17 +56,47 @@ public int getAutoQueryTypes(JTextComponent component,
String typedText) {
private static class MicronautDataCompletionQuery extends
AsyncCompletionQuery {
+ private static final String ICON =
"org/netbeans/modules/micronaut/resources/micronaut.png";
+
@Override
protected void query(CompletionResultSet resultSet, Document doc, int
caretOffset) {
MicronautDataCompletionTask task = new
MicronautDataCompletionTask();
- resultSet.addAllItems(task.query(doc, caretOffset, new
MicronautDataCompletionTask.ItemFactory<MicronautDataCompletionItem>() {
+ resultSet.addAllItems(task.query(doc, caretOffset, new
MicronautDataCompletionTask.ItemFactory<CompletionItem>() {
@Override
- public MicronautDataCompletionItem
createFinderMethodItem(String name, String returnType, int offset) {
- return
MicronautDataCompletionItem.createFinderMethodItem(name, returnType, offset);
+ public CompletionItem createFinderMethodItem(String name,
String returnType, int offset) {
+ CompletionUtilities.CompletionItemBuilder builder =
CompletionUtilities.newCompletionItemBuilder(name)
+ .startOffset(offset)
+ .iconResource(ICON)
+ .leftHtmlText("<b>" + name + "</b>")
+ .sortPriority(10);
+ if (returnType != null) {
+ builder.onSelect((component, overwrite) -> {
+ final BaseDocument doc = (BaseDocument)
component.getDocument();
Review comment:
Fixed.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists