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

Fix: Use "filterText" (fallback to "label") for the trigger of the completion item #551

Merged
merged 1 commit into from Apr 5, 2019

Conversation

rwols
Copy link
Member

@rwols rwols commented Apr 4, 2019

An option is added to always prefer "label" over the "filterText" if the user so desires. However, certain language servers might use the "label" to denote extra data, e.g. a circular dot in front of the word-to-complete in case it returns a completion with an "additionalTextEdits" key. In this case, using the "label" for the ST trigger characters can give wrong behavior. An example of this wrong behavior is: #368

One can take a look at the completion_test.py file to get a feel for what this change entails.

ping @ayoub-benali @frou

@rwols rwols added the bug label Apr 4, 2019
@rwols rwols requested a review from tomv564 April 4, 2019 20:42
@rwols rwols force-pushed the bugfix/completions branch 3 times, most recently from f68a320 to 47887e0 Compare April 4, 2019 20:55
@coveralls
Copy link

Coverage Status

Coverage increased (+0.006%) to 26.705% when pulling 495fb92 on bugfix/completions into bcada7c on master.

@ayoub-benali
Copy link
Contributor

However, certain language servers might

Another argument to have the "label" actually the default and using the "filterText" as the exception. i.e. I would flip default of prefer_label_over_filter_text flag

Copy link
Contributor

@tomv564 tomv564 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I accept the change of default behaviour although based on the premise that:

We cannot do something useful with 'dressed up' label content in Sublime Text,
and language servers can be expected to send fairly 'plain' content in the filterText field.

An expected issue is with completions with leading $ characters, would be great if someone tested a PHP language server with this behaviour.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants