Skip to content
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): respond in chat right away when user enters JDK path #6275

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"type": "Bug Fix",
"description": "Amazon Q Code Transformation: respond immediately when entering JAVA_HOME path"
}
3 changes: 3 additions & 0 deletions packages/core/src/codewhisperer/models/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -570,6 +570,9 @@ export const checkingForProjectsChatMessage = 'Checking for eligible projects...
export const buildStartedChatMessage =
'I am building your project. This can take up to 10 minutes, depending on the size of your project.'

export const buildStartedNotification =
'Amazon Q is building your project. This can take up to 10 minutes, depending on the size of your project.'

export const buildSucceededChatMessage = 'I was able to build your project and will start transforming your code soon.'

export const buildSucceededNotification =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ function copyProjectDependencies(dependenciesFolder: FolderInfo, modulePath: str
}

export async function prepareProjectDependencies(dependenciesFolder: FolderInfo, rootPomPath: string) {
void vscode.window.showInformationMessage(CodeWhispererConstants.buildStartedNotification)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need this here anyway as an unrelated change, but still need to figure out a better solution besides sleeping for half a second

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like the few chat messages which should be showing up one-at-a-time before the copyProjectDependencies and installProjectDependencies functions below start, are actually showing up all at once after both of these functions complete. I guess that means these 2 functions are blocking the event loop, which is why adding a small delay before they begin provides enough time for the queued chat messages to send. Haven't been able to find another solution besides adding this delay.

Downsides are that it does delay for all users, and unclear if 500ms will always be enough of a delay.

try {
copyProjectDependencies(dependenciesFolder, rootPomPath)
} catch (err) {
Expand Down
Loading