Skip to content

Support incomplete LSP completion lists #3256

@aofei

Description

@aofei

Background

The XGo code editor currently only consumes CompletionItem[] from textDocument/completion. When completion remains active and the user keeps typing inside the same word, the client filters the previously returned items locally instead of sending another completion request.

This is not enough for dynamic completion results such as XGo unit suffixes. For example, after requesting completion at wait 1, the server may return items with filterText and textEdit.range computed for that position. If the user continues typing to wait 12, the old items are filtered locally and their server-provided edit ranges are stale.

Goal

Support LSP CompletionList results and honor isIncomplete.

Expected behavior

  • The frontend should accept both CompletionItem[] and CompletionList
  • When the active completion list is incomplete, continued typing should trigger a new completion request instead of only filtering existing items
  • xgolsw should return CompletionList { isIncomplete: true, items } for completion contexts whose results or edit ranges depend on the current typed text, such as XGo unit suffix completions

Notes

PR #3238 uses a small frontend workaround for textEdit items. It should be replaced by CompletionList.isIncomplete once this is supported.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions