microsoft / microsoft/language-server-protocol

What's the expected behaviour of CompletionList.isIncomplete=false when the user presses backspace?

Open
#954 14 comments 5 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

clarification completion
Dominant language
TypeScript
Stars
13k
Forks
1k
Avg merge
6d 1h
Merged PRs (30d)
10

Description

My understanding is that if IsIncomplete=true, the client will not cache results and must go back to the server whenever the user types a character (this allows the server to return a partial set of results).

Currently in Dart we use IsIncomplete=false - eg. we give the full list to VS Code and allow it to filter client side.

There has been an assumption that I don't think is well described in the spec, relating to whether the client should supply all possible completions given the current prefix or all possible completions for the current location regardless of prefix.

For example, let's say my completion list simple has:

  • one
  • two
  • three

If the user invokes completion where ^ is here:

print(on^

If the server is using IsIncomplete=false (eg. it's providing the full list), should it include two and three here, on the assumption that the client will not call the server again even if the user hits backspace, or should it assume that the client-side filtering is only for typing forwards?

The spec is a bit vague on this (it's not clear what "Further typing" covers, and "recomputing" is also a little vague - I presume it means "the client should re-request completions from the server").

This list it not complete. Further typing should result in recomputing this list.

If pressing backspace is intended to re-call the server even when IsIncomplete=false, then significant gains could be made for us by filtering based on the prefix on the server.

Thanks!

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the CompletionList specification passage quoted in the issue, then review the 14-comment thread for the unresolved interpretations of IsIncomplete=false, client-side filtering, and backspace. Done means the expected client behavior is decided and documented clearly in the protocol specification.

Written by the indexing model from the issue text.

Assessment

Domain
api, documentation
Issue type
Documentation
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.