-
Notifications
You must be signed in to change notification settings - Fork 274
auto-trigger a/b #4961
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
Merged
Merged
auto-trigger a/b #4961
Changes from 10 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
db17201
auto-trigger a/b
andrewyuq fa88de2
fix compile error
andrewyuq cc11b69
detekt fix
andrewyuq d994940
Keep one topic for all the listeners and changes around coroutine
andrewyuq 33d4e08
test fix
andrewyuq 2cb9b39
detekt fix
andrewyuq 1303b46
change force accept to shift+tab and remove opt+ enter
andrewyuq e120665
keybinding change
andrewyuq e3e519e
Merge branch 'main' into auto-trigger-review
andrewyuq 3e923de
Merge branch 'main' into auto-trigger-review
andrewyuq 4f23afb
change feature value to be string as service config has
andrewyuq b932c2c
test fix
andrewyuq 0bd02a8
Revert "test fix"
andrewyuq ee630fd
test fix
andrewyuq 450dbbf
Merge branch 'main' into auto-trigger-review
andrewyuq File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
...ftware/aws/toolkits/jetbrains/services/codewhisperer/actions/CodeWhispererAcceptAction.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| // Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
| // SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| package software.aws.toolkits.jetbrains.services.codewhisperer.actions | ||
|
|
||
| import com.intellij.openapi.actionSystem.ActionUpdateThread | ||
| import com.intellij.openapi.actionSystem.AnAction | ||
| import com.intellij.openapi.actionSystem.AnActionEvent | ||
| import com.intellij.openapi.actionSystem.CommonDataKeys | ||
| import com.intellij.openapi.application.ApplicationManager | ||
| import com.intellij.openapi.project.DumbAware | ||
| import software.aws.toolkits.jetbrains.services.codewhisperer.popup.CodeWhispererPopupManager | ||
| import software.aws.toolkits.jetbrains.services.codewhisperer.service.CodeWhispererInvocationStatusNew | ||
| import software.aws.toolkits.jetbrains.services.codewhisperer.service.CodeWhispererServiceNew | ||
| import software.aws.toolkits.resources.message | ||
|
|
||
| open class CodeWhispererAcceptAction(title: String = message("codewhisperer.inline.accept")) : AnAction(title), DumbAware { | ||
| override fun getActionUpdateThread(): ActionUpdateThread = ActionUpdateThread.EDT | ||
|
|
||
| override fun update(e: AnActionEvent) { | ||
| e.presentation.isEnabled = e.project != null && e.getData(CommonDataKeys.EDITOR) != null && | ||
| CodeWhispererInvocationStatusNew.getInstance().isDisplaySessionActive() | ||
| } | ||
|
|
||
| override fun actionPerformed(e: AnActionEvent) { | ||
| val sessionContext = e.project?.getUserData(CodeWhispererServiceNew.KEY_SESSION_CONTEXT) ?: return | ||
| if (!CodeWhispererInvocationStatusNew.getInstance().isDisplaySessionActive()) return | ||
| ApplicationManager.getApplication().messageBus.syncPublisher( | ||
| CodeWhispererPopupManager.CODEWHISPERER_USER_ACTION_PERFORMED | ||
| ).beforeAccept(sessionContext) | ||
| } | ||
| } | ||
|
|
||
| // A same accept action but different key shortcut and different promoter logic | ||
| class CodeWhispererForceAcceptAction(title: String = message("codewhisperer.inline.force.accept")) : CodeWhispererAcceptAction(title) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
.../aws/toolkits/jetbrains/services/codewhisperer/actions/CodeWhispererNavigateNextAction.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| // Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
| // SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| package software.aws.toolkits.jetbrains.services.codewhisperer.actions | ||
|
|
||
| import com.intellij.openapi.actionSystem.ActionUpdateThread | ||
| import com.intellij.openapi.actionSystem.AnAction | ||
| import com.intellij.openapi.actionSystem.AnActionEvent | ||
| import com.intellij.openapi.actionSystem.CommonDataKeys | ||
| import com.intellij.openapi.application.ApplicationManager | ||
| import com.intellij.openapi.project.DumbAware | ||
| import software.aws.toolkits.jetbrains.services.codewhisperer.popup.CodeWhispererPopupManager | ||
| import software.aws.toolkits.jetbrains.services.codewhisperer.service.CodeWhispererInvocationStatusNew | ||
| import software.aws.toolkits.jetbrains.services.codewhisperer.service.CodeWhispererServiceNew | ||
| import software.aws.toolkits.resources.message | ||
|
|
||
| class CodeWhispererNavigateNextAction : AnAction(message("codewhisperer.inline.navigate.next")), DumbAware { | ||
| override fun getActionUpdateThread(): ActionUpdateThread = ActionUpdateThread.EDT | ||
|
|
||
| override fun update(e: AnActionEvent) { | ||
| e.presentation.isEnabled = e.project != null && | ||
| e.getData(CommonDataKeys.EDITOR) != null && | ||
| CodeWhispererInvocationStatusNew.getInstance().isDisplaySessionActive() | ||
| } | ||
|
|
||
| override fun actionPerformed(e: AnActionEvent) { | ||
| val sessionContext = e.project?.getUserData(CodeWhispererServiceNew.KEY_SESSION_CONTEXT) ?: return | ||
| if (!CodeWhispererInvocationStatusNew.getInstance().isDisplaySessionActive()) return | ||
| ApplicationManager.getApplication().messageBus.syncPublisher( | ||
| CodeWhispererPopupManager.CODEWHISPERER_USER_ACTION_PERFORMED | ||
| ).navigateNext(sessionContext) | ||
| } | ||
| } |
33 changes: 33 additions & 0 deletions
33
.../aws/toolkits/jetbrains/services/codewhisperer/actions/CodeWhispererNavigatePrevAction.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| // Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
| // SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| package software.aws.toolkits.jetbrains.services.codewhisperer.actions | ||
|
|
||
| import com.intellij.openapi.actionSystem.ActionUpdateThread | ||
| import com.intellij.openapi.actionSystem.AnAction | ||
| import com.intellij.openapi.actionSystem.AnActionEvent | ||
| import com.intellij.openapi.actionSystem.CommonDataKeys | ||
| import com.intellij.openapi.application.ApplicationManager | ||
| import com.intellij.openapi.project.DumbAware | ||
| import software.aws.toolkits.jetbrains.services.codewhisperer.popup.CodeWhispererPopupManager | ||
| import software.aws.toolkits.jetbrains.services.codewhisperer.service.CodeWhispererInvocationStatusNew | ||
| import software.aws.toolkits.jetbrains.services.codewhisperer.service.CodeWhispererServiceNew | ||
| import software.aws.toolkits.resources.message | ||
|
|
||
| class CodeWhispererNavigatePrevAction : AnAction(message("codewhisperer.inline.navigate.previous")), DumbAware { | ||
| override fun getActionUpdateThread(): ActionUpdateThread = ActionUpdateThread.EDT | ||
|
|
||
| override fun update(e: AnActionEvent) { | ||
| e.presentation.isEnabled = e.project != null && | ||
| e.getData(CommonDataKeys.EDITOR) != null && | ||
| CodeWhispererInvocationStatusNew.getInstance().isDisplaySessionActive() | ||
| } | ||
|
|
||
| override fun actionPerformed(e: AnActionEvent) { | ||
| val sessionContext = e.project?.getUserData(CodeWhispererServiceNew.KEY_SESSION_CONTEXT) ?: return | ||
| if (!CodeWhispererInvocationStatusNew.getInstance().isDisplaySessionActive()) return | ||
| ApplicationManager.getApplication().messageBus.syncPublisher( | ||
| CodeWhispererPopupManager.CODEWHISPERER_USER_ACTION_PERFORMED | ||
| ).navigatePrevious(sessionContext) | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 0 additions & 32 deletions
32
...s/toolkits/jetbrains/services/codewhisperer/actions/ConnectWithAwsToContinueActionWarn.kt
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
can avoid working around typecast issues if you declare a common interface