-
Notifications
You must be signed in to change notification settings - Fork 274
fix(amazonq): default keybinding for inline chat conflicts #5026
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
Changes from 3 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
a72c118
fix(amazonq): default keybinding for inline chat conflicts
zixlin7 600c97a
pr feedback
zixlin7 4d7ef67
add change log
zixlin7 1ab3c49
Merge branch 'main' into fixKeyBinding
zixlin7 c3c01cd
add editor and project check
zixlin7 c497a3e
Update .changes/next-release/bugfix-cfa2c364-8910-4dd8-ac1a-09da66907…
zixlin7 259f090
Update plugins/amazonq/chat/jetbrains-community/src/software/aws/tool…
zixlin7 af50704
fix
zixlin7 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
4 changes: 4 additions & 0 deletions
4
.changes/next-release/bugfix-cfa2c364-8910-4dd8-ac1a-09da6690720e.json
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,4 @@ | ||
| { | ||
| "type" : "bugfix", | ||
| "description" : "inline chat default key binding might not work on windows and linux" | ||
| } | ||
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
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
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
...unity/src/software/aws/toolkits/jetbrains/services/cwc/inline/InlineChatActionPromoter.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.cwc.inline | ||
|
|
||
| import com.intellij.openapi.actionSystem.ActionPromoter | ||
| import com.intellij.openapi.actionSystem.AnAction | ||
| import com.intellij.openapi.actionSystem.DataContext | ||
| import com.intellij.openapi.keymap.KeymapUtil | ||
| import com.intellij.openapi.util.SystemInfo | ||
|
|
||
| class InlineChatActionPromoter : ActionPromoter { | ||
|
||
| // temporary until we find a better key binding | ||
| override fun promote(actions: MutableList<out AnAction>, context: DataContext): MutableList<AnAction> { | ||
zixlin7 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| val results = actions.toMutableList() | ||
| val shortCut = KeymapUtil.getShortcutText("aws.toolkit.jetbrains.core.services.cwc.inline.openChat") | ||
| // only promote for the default key bindings | ||
| if (SystemInfo.isMac && shortCut != "⌘I") return results | ||
| if (!SystemInfo.isMac && shortCut != "Ctrl+I") return results | ||
|
|
||
| results.sortWith { a, b -> | ||
| when { | ||
| isOpenChatInputAction(a) -> -1 | ||
| isOpenChatInputAction(b) -> 1 | ||
| else -> 0 | ||
| } | ||
| } | ||
| return results | ||
zixlin7 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| } | ||
|
|
||
| private fun isOpenChatInputAction(action: AnAction): Boolean = | ||
| action is OpenChatInputAction | ||
| } | ||
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
4 changes: 0 additions & 4 deletions
4
...community/resources/icons/resources/inlinechat/amazonq_inline_chat_shortcut.svg
This file was deleted.
Oops, something went wrong.
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
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.
Uh oh!
There was an error while loading. Please reload this page.