You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor(amazonq): separate edits from completion code path (aws#7793)
## Problem
related aws/language-servers#2058
Edits as a newly introduced feature, previously the implementation was
living in the same flow as Completion. However the 2 suggestion types
have few different product requirements, thus we decided to completely
separate these 2 suggestions out in terms of their code path.
Key difference
- Language server will process Completion request on receiving request
from IDE clients, and will BLOCK following requests if in-flight request
is not fulfilled yet. Edits, on the other hand, it debounces/delay the
execution time for the sake of "latest" file context to ensure the
suggestion reflects the CORRECT changes users attempt to make.
- Triggering heuristic. For example, Completion is not supposed to be
invoked when users are deleting the code, whereas Edits allow such
scenario to go through.
## Solution
- Introduce a new `onEditCompletion` language server API which is purely
for Edits suggestion.
- Invoke 2 Flare API and serve the response which first arrives (First
come first served).
- Allow Edits suggestion on code deletion
---
- Treat all work as PUBLIC. Private `feature/x` branches will not be
squash-merged at release time.
- Your code changes must meet the guidelines in
[CONTRIBUTING.md](https://github.com/aws/aws-toolkit-vscode/blob/master/CONTRIBUTING.md#guidelines).
- License: I confirm that my contribution is made under the terms of the
Apache 2.0 license.
* IsTriggerByDeletion is to prevent user deletion invoking Completions.
131
+
* PartialResultToken is not a hack for now since only Edits suggestion use partialResultToken across different calls of [getAllRecommendations],
132
+
* Completions use PartialResultToken with single 1 call of [getAllRecommendations].
133
+
* Edits leverage partialResultToken to achieve EditStreak such that clients can pull all continuous suggestions generated by the model within 1 EOS block.
* Though Edit request is sent on keystrokes everytime, the language server will execute the request in a debounced manner so that it won't be immediately executed.
0 commit comments