fix(amazonq): do not auto trigger if the ongoing typeahead does not match #7924
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.
Problem
Bug: When inline suggestion is active but user types a character that does not match the typeahead, this typing event triggered a inline completion API call that eventually did not manage to display suggestion on screen, which eventually reported as rejected completions.
Solution
Previously, before Flare migration, we had this design:
https://github.com/aws/aws-toolkit-vscode/blob/amazonq/v1.74.0/packages/amazonq/src/app/inline/activation.ts#L108
Auto trigger will be disabled if at that moment the suggestion is visible.
Under the previous design, the first character that does not match the typeahead will not make a new auto trigger, it simply rejects the current inline completion.
This PR is to bring back the old design.
It is not customer facing, hence no change log.
feature/xbranches will not be squash-merged at release time.