aws / aws-toolkit-vscode

Amazon Q, CodeCatalyst, Local Lambda debug, SAM/CFN syntax, ECS Terminal, AWS resources
https://marketplace.visualstudio.com/items?itemName=AmazonWebServices.amazon-q-vscode
Apache License 2.0
1.51k stars 436 forks source link

fix(amazonq): "rejectCodeSuggestion not found" after ctrl-z #5482

Closed leigaol closed 2 months ago

leigaol commented 2 months ago

Problem

This is an alternative to the fix in https://github.com/aws/aws-toolkit-vscode/pull/5474/files.

Solution

Test case 1: Trigger suggestion, accept it, ctrl +z, saw same suggestion, press Esc, suggestion disappears. The error command not found is not thrown. In this case, user can also reject it by keep typing to ignore it.

Test case 2: Install Vim. Trigger suggestion, accept it, ctrl +z, saw same suggestion, press Esc, suggestion disappears. The error command not found is not thrown. In this case, user can also reject it by keep typing to ignore it. .

Test case 3: Install Vim. Trigger suggestion, press left or right, the navigation is still not working(because Vim overrides the left right keys with highest priority), however, there is no crash anymore and user can still accept or reject the inline suggestion.

Test case 4: Install Q and other code suggestion extensions, with this change, the key bindings are always under our extension, so when their suggestion shows, it triggers our command which breaks their experience.

License

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.