-
Notifications
You must be signed in to change notification settings - Fork 746
fix(amazonq): Render first response before receiving all paginated inline completion results #7663
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| { | ||
| "type": "Bug Fix", | ||
| "description": "Render first response before receiving all paginated inline completion results" | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -24,6 +24,7 @@ export interface CodeWhispererSession { | |
| export class SessionManager { | ||
| private activeSession?: CodeWhispererSession | ||
| private _acceptedSuggestionCount: number = 0 | ||
| private _refreshedSessions = new Set<string>() | ||
leigaol marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| constructor() {} | ||
|
|
||
|
|
@@ -86,4 +87,20 @@ export class SessionManager { | |
| public clear() { | ||
| this.activeSession = undefined | ||
| } | ||
|
|
||
| // re-render the session ghost text to display paginated responses once per completed session | ||
| public async maybeRefreshSessionUx() { | ||
| if ( | ||
| this.activeSession && | ||
| !this.activeSession.isRequestInProgress && | ||
| !this._refreshedSessions.has(this.activeSession.sessionId) | ||
| ) { | ||
| await vscode.commands.executeCommand('editor.action.inlineSuggest.hide') | ||
| await vscode.commands.executeCommand('editor.action.inlineSuggest.trigger') | ||
| if (this._refreshedSessions.size > 1000) { | ||
| this._refreshedSessions.clear() | ||
| } | ||
| this._refreshedSessions.add(this.activeSession.sessionId) | ||
| } | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @leigaol so this will only be invoked when cx click ">" or "<" correct? So the suggestions in the pagination response will only be rendered once they press either keyboard shortcut right?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes. Do not render paginated response if there is no Left Right key input. |
||
| } | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.