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.
Background
The XGo code editor currently only consumes
CompletionItem[]fromtextDocument/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 withfilterTextandtextEdit.rangecomputed for that position. If the user continues typing towait 12, the old items are filtered locally and their server-provided edit ranges are stale.Goal
Support LSP
CompletionListresults and honorisIncomplete.Expected behavior
CompletionItem[]andCompletionListCompletionList { isIncomplete: true, items }for completion contexts whose results or edit ranges depend on the current typed text, such as XGo unit suffix completionsNotes
PR #3238 uses a small frontend workaround for
textEdititems. It should be replaced byCompletionList.isIncompleteonce this is supported.