Skip to content

Conversation

@leigaol
Copy link
Contributor

@leigaol leigaol commented May 9, 2025

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

Description

Screenshot 2025-05-08 at 5 05 30 PM

ref: https://github.com/aws/aws-toolkit-vscode/pull/7169/files

Checklist

  • My code follows the code style of this project
  • I have added tests to cover my changes
  • A short description of the change has been added to the CHANGELOG if the change is customer-facing in the IDE.
  • I have added metrics for my changes (if required)

License

I confirm that my contribution is made under the terms of the Apache 2.0 license.

@leigaol leigaol requested a review from a team as a code owner May 9, 2025 00:09
@leigaol leigaol marked this pull request as draft May 9, 2025 00:09
@leigaol leigaol marked this pull request as ready for review May 9, 2025 18:22
_messages.tryEmit(ContextMenuActionMessage(command, project))
} else {
// new agentic chat route
runBlocking {
Copy link
Contributor

Choose a reason for hiding this comment

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

this will block edt

Copy link
Contributor Author

Choose a reason for hiding this comment

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

well if I mark reportMessageClick as suspend it would require me to mark other functions as suspend.

Should I launch with coroutine?

Copy link
Contributor

Choose a reason for hiding this comment

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

i really don't like ActionRegistrar
let's just do

ApplicationManager.getApplication().executeOnPooledThread {
    runBlocking {
...
    }
}

Copy link
Contributor

Choose a reason for hiding this comment

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

maybe try this https://youtrack.jetbrains.com/issue/IJPL-371/Provide-currentThreadCoroutineScope-inside-AnActionactionPerformed

you can request a coroutine scope from the platform in the action system

Copy link
Contributor

Choose a reason for hiding this comment

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

maybe like

        currentThreadCoroutineScope().launch(getCoroutineBgContext()) {
            ActionRegistrar.instance.reportMessageClick
        }

Copy link
Contributor

Choose a reason for hiding this comment

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

We can skip ActionRegistrar for these and handle it in custom action

Copy link
Contributor Author

Choose a reason for hiding this comment

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

skip ActionRegistrar for these and handle it in custom action
This would require more lines of code.

@rli rli merged commit 5f52add into aws:feature/q-lsp-chat May 9, 2025
11 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants