Skip to content

filterText seems ignored in autocompletion #26874

@fbricon

Description

@fbricon

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.

screen shot 2017-04-19 at 9 48 50 am

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
may-15-2017 13-24-42

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?

Metadata

Metadata

Assignees

Labels

bugIssue identified by VS Code Team member as probable bugsuggestIntelliSense, Auto CompleteverifiedVerification succeeded

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions