This is a follow-up on redhat-developer/vscode-java#187
In vscode-java, completion item labels are formatted as type - package, because we find it more user friendly to display the package immediately, instead of relying on selecting the item to show the details content. This is how all Java IDEs present autocompletion results anyway.
Because the label contain spaces, autocompletion doesn't stop when typing a space, which is annoying.

So we tried using filterText instead, as the protocol states:
/**
* A string that should be used when filtering a set of
* completion items. When `falsy` the label is used.
*/
filterText?: string;
So our completionItems now look like
{
"label": "Map - java.util",
"kind": 7,
"sortText": "zzzzzzzbge",
"filterText": "Map",
"data": {
"decl_signature": "Ljava.util.Map;",
"pid": "62",
"rid": "6",
"uri": "file:/Users/fbricon/Dev/vertx-game-server/src/main/java/com/redhat/middleware/keynote/GameUtils.java"
}
},
But vscode still seems to filter using the label

To which @jrieken replied:
Yeah, we always try with the label first and use the filter text only when not matching the label.
Mostly because when using the filter text we cannot render the blue highlights. But it could be
considered a bug on our side
Would it be possible to decouple filtering from highlighting here?
This is a follow-up on redhat-developer/vscode-java#187
In vscode-java, completion item labels are formatted as
type - package, because we find it more user friendly to display the package immediately, instead of relying on selecting the item to show the details content. This is how all Java IDEs present autocompletion results anyway.Because the label contain spaces, autocompletion doesn't stop when typing a space, which is annoying.
So we tried using filterText instead, as the protocol states:
So our completionItems now look like
{ "label": "Map - java.util", "kind": 7, "sortText": "zzzzzzzbge", "filterText": "Map", "data": { "decl_signature": "Ljava.util.Map;", "pid": "62", "rid": "6", "uri": "file:/Users/fbricon/Dev/vertx-game-server/src/main/java/com/redhat/middleware/keynote/GameUtils.java" } },But vscode still seems to filter using the label

To which @jrieken replied:
Would it be possible to decouple filtering from highlighting here?