-
Notifications
You must be signed in to change notification settings - Fork 597
fix(amazonq): inline suggestion scrolling now uses built-in VSC commands. #7323
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(amazonq): inline suggestion scrolling now uses built-in VSC commands. #7323
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
lint-duplicate-code failure is unrelated:
|
To show prev. and next. recommendation we need to re-register a new provider with the previous or next item | ||
*/ | ||
|
||
const swapProviderAndShow = async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cc @zixlin7 was this stuff added to support inline completions that come after the initial request? or is it no longer needed? As far as I can see from the demo we still have pagination
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My understanding of the old implementation is that we fetch all the suggestions, add them to the session, and then request them from the session one at a time (by triggering the provideInlineCompletion
via overwriting the scroll commands). This is where the state tracking comes in to manage what the "active" suggestion is. We also add 'placeholder' items so that VSC knows we can scroll.
Since we're fetching all the suggestions anyway, we can return those directly and avoid 'placeholder' items, and additional triggers of provideInlineCompletion
.
However, I don't have all the context on the original reason for this decision.
When testing this, I also noticed a slight bug on current prod where it always shows were on suggestion 1, even when we scroll.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Checked with Zoe and sounds like this is a hack to handle the codelenses for references and imports.
- references are confirmed working in fix(amazonq): code reference codelense works #7331.
- import codelense is unknown. Note: There weren't any reported issue in first three bug bashes, so either this is not a common case, or already works. However, still worth following up to confirm this.
builds off #7323 ## Problem - Code reference codelense doesn't open the code reference panel, it opens problems. - Sometimes the codelense never goes away. (Note: both of these bugs are on prod) ## Solution - Hide the codelense after 5 seconds. - Properly link the codelense to code reference log panel. ## Verification https://github.com/user-attachments/assets/3a231ab4-1e25-4746-864a-d66f5e852686 --- - 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.
Problem
The current implementation overwrites the
editor.action.inlineSuggest.showPrevious
andeditor.action.inlineSuggest.showNext
commands to swap out the inlineProvider. These custom overwrites cause a few issues:Solution
session
state.Fixed Bugs
Tests and Verification:
Testing this change it feels significantly 'smoother'.
suggestionScrollingFIx.mov
Future Work
feature/x
branches will not be squash-merged at release time.