Autocomplete: Improve suggest widget interop and add feature flag #1158
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #808
This PR does a few distinct things:
completionMatchesPopupItem
behavior (where we reimplement when a completion is shown in VS Code). Turns out that sometimes, with the completion range being extended to start at the beginning of the line, we don't have the right text to compare it against. This fixes it.lastCompletionRequest
. We can use this to know if only the suggest widget was changed and use this to complete from the suggest widget selection. This fixes the number 1 issue people had with Autocomplete: completeSuggestWidgetSelection improvements #808 where low quality suggest widget selection caused a bad experience. Now, we only use the suggest widget if the user changed it or it happens to match the completion we would do without considering this. This results in a much nicer UX IMO.Test plan
Screen.Recording.2023-09-26.at.14.39.09.mov
(One time it appears to be buggy but you can see the backend returns
go
instead ofog
for.log
🙃