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

Request for clarification regarding CompletionItem. #2042

Open
grokys opened this issue Oct 16, 2024 · 0 comments
Open

Request for clarification regarding CompletionItem. #2042

grokys opened this issue Oct 16, 2024 · 0 comments

Comments

@grokys
Copy link

grokys commented Oct 16, 2024

The spec says:

A completion item provides additional means to influence filtering and sorting. They are expressed by either creating a CompletionItem with a insertText or with a textEdit. The two modes differ as follows:

Completion item provides an insertText / label without a text edit: in the model the client should filter against what the user has already typed using the word boundary rules of the language (e.g. resolving the word under the cursor position). The reason for this mode is that it makes it extremely easy for a server to implement a basic completion list and get it filtered on the client.

Completion Item with text edits: in this mode the server tells the client that it actually knows what it is doing. If you create a completion item with a text edit at the current cursor position no word guessing takes place and no filtering should happen. This mode can be combined with a sort text and filter text to customize two things. If the text edit is a replace edit then the range denotes the word used for filtering. If the replace changes the text it most likely makes sense to specify a filter text to be used.

I would like clarification around two seemingly conflicting statements in the "Completion Item with text edits" paragraph:

If you create a completion item with a text edit at the current cursor position no word guessing takes place and no filtering should happen.

This mode can be combined with a sort text and filter text to customize two things. If the text edit is a replace edit then the range denotes the word used for filtering.

The first quote says "no filtering should happen" but the second talks about customizing filtering. Should client-side filtering happen here or not?

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

No branches or pull requests

1 participant