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

Editor does not filter code completion proposals from language server #2592

Closed
kaloyan-raev opened this issue Sep 26, 2016 · 2 comments
Closed
Labels
sprint/next status/analyzing An issue has been proposed and it is currently being analyzed for effort and implementation approach

Comments

@kaloyan-raev
Copy link
Contributor

As visible on the below screenshot, the editor does not filter the completion proposals retrieved from the language server. I would expect to have only the "name" item in the list, but I get a lot more.

code-completion-filtering

While for JSON files the completion proposal list is relatively short, for programming language like Java, PHP and others it can be exhaustive. Lack of filtering would make the code completion feature unusable.

Note that the issue is not specific to the JSON editor, but for any editor using a language server (see #1287).

Reproduction Steps:

  1. Have a build including Fix #2471: Send json/schemaAssociations notification #2474
  2. Create a composer.json file.
  3. Start typing a key (like on the screenshot) and invoke code completion.

Expected behavior:

The list of completion items is filtered in the editor.

Observed behavior:

The list of completion items is not filtered at all.

Che version: build from PR #2474
OS and version: Fedora 24
Docker version: 1.10.3
Che install: local build, started with the bin/che.sh script

Additional information:

  • Problem started happening recently, didn't happen in an older version of Che: [No]
  • Problem can be reliably reproduced, doesn't happen randomly: [Yes]
@kaloyan-raev kaloyan-raev mentioned this issue Sep 26, 2016
34 tasks
@vparfonov vparfonov added status/analyzing An issue has been proposed and it is currently being analyzed for effort and implementation approach sprint/next team/ide labels Sep 29, 2016
@vparfonov
Copy link
Contributor

Not sure it is bug on client side looks like LS should give as already filtered result. We will take a look

@kaloyan-raev
Copy link
Contributor Author

This is how it works in VS Code. The JSON language server make only context-based filtering. Then it leaves the client to decide how to execute the filtering based on the user input: using startWith, substring or fuzzy matching strategy. This is why the LSP defines the filterText property for the CompletionItem.

Of course, the language server can decide to implement the text-input filtering itself, but this is not strictly defined by the protocol. Even if the server does it, there is no drawback if the client does it once again - e.g. for displaying the highlighting in the completion proposal window.

BTW, I am almost done on a PR based on the FuzzyMatcher used for the GoToSymbolAction.

kaloyan-raev added a commit to kaloyan-raev/che that referenced this issue Sep 29, 2016
…e server

Implements filtering based on the existing FuzzyMatches used for the
GoToSymbolAction.
kaloyan-raev added a commit to kaloyan-raev/che that referenced this issue Sep 29, 2016
…e server

Implements filtering based on the existing FuzzyMatches used for the
GoToSymbolAction.

Signed-off-by: Kaloyan Raev <kaloyan.r@zend.com>
JPinkney pushed a commit to JPinkney/che that referenced this issue Aug 17, 2017
…e server (eclipse-che#2658)

* Fixes eclipse-che#2592: Filter code completion proposals from language server

Implements filtering based on the existing FuzzyMatches used for the
GoToSymbolAction.

Signed-off-by: Kaloyan Raev <kaloyan.r@zend.com>

* Add empty line at end of file.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sprint/next status/analyzing An issue has been proposed and it is currently being analyzed for effort and implementation approach
Projects
None yet
Development

No branches or pull requests

2 participants