Skip to content

Commit 4734331

Browse files
committed
Merge remote-tracking branch 'origin/main' into samgst/UserFacingNetworkErrors
Merge remote-tracking branch 'origin/main' into samgst/UserFacingNetworkErrors
2 parents 57d63ff + e121827 commit 4734331

File tree

22 files changed

+155
-59
lines changed

22 files changed

+155
-59
lines changed

.changes/3.36.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"date" : "2024-10-30",
3+
"version" : "3.36",
4+
"entries" : [ {
5+
"type" : "bugfix",
6+
"description" : "Fix inline chat default key binding not working on windows and linux"
7+
} ]
8+
}

.github/workflows/prerelease.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ jobs:
2020
- uses: actions/checkout@v4
2121
with:
2222
fetch-depth: 0
23-
- name: remove unwanted dependencies
24-
run: |
25-
sudo rm -rf /usr/share/dotnet
26-
sudo rm -rf /opt/ghc
27-
sudo rm -rf "/usr/local/share/boost"
28-
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
23+
- name: Maximize Build Space
24+
if: runner.os == 'Linux'
25+
uses: jlumbroso/free-disk-space@main
26+
with:
27+
tool-cache: false
28+
large-packages: false
2929
- uses: actions/setup-java@v4
3030
with:
3131
distribution: 'corretto'

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# _3.36_ (2024-10-30)
2+
- **(Bug Fix)** Fix inline chat default key binding not working on windows and linux
3+
14
# _3.35_ (2024-10-29)
25
- **(Feature)** Remove read-only mode on before diff of code changes generated by agent
36
- **(Feature)** Provide more frequent updates about code changes made by agent

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# SPDX-License-Identifier: Apache-2.0
33

44
# Toolkit Version
5-
toolkitVersion=3.36-SNAPSHOT
5+
toolkitVersion=3.37-SNAPSHOT
66

77
# Publish Settings
88
publishToken=

gradle/libs.versions.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
[versions]
22
apache-commons-collections = "4.4"
33
apache-commons-io = "2.16.0"
4+
apache-commons-text = "1.12.0"
45
assertJ = "3.26.3"
56
# match with <root>/settings.gradle.kts
67
awsSdk = "2.26.25"
@@ -70,6 +71,7 @@ aws-sts = { module = "software.amazon.awssdk:sts", version.ref = "awsSdk" }
7071
commonmark = { module = "org.commonmark:commonmark", version.ref = "commonmark" }
7172
commons-collections = { module = "org.apache.commons:commons-collections4", version.ref = "apache-commons-collections" }
7273
commons-io = { module = "commons-io:commons-io", version.ref = "apache-commons-io" }
74+
commons-text = {module = "org.apache.commons:commons-text", version.ref = "apache-commons-text"}
7375
detekt-api = { module = "io.gitlab.arturbosch.detekt:detekt-api", version.ref = "detekt" }
7476
detekt-formattingRules = { module = "io.gitlab.arturbosch.detekt:detekt-formatting", version.ref = "detekt" }
7577
diff-util = { module = "io.github.java-diff-utils:java-diff-utils", version.ref = "diff-util" }

plugins/amazonq/chat/jetbrains-community/build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ dependencies {
2020
// everything references codewhisperer, which is not ideal
2121
implementation(project(":plugin-amazonq:codewhisperer:jetbrains-community"))
2222
implementation(libs.diff.util)
23+
implementation(libs.commons.text)
2324

2425
compileOnly(project(":plugin-core:jetbrains-community"))
2526

plugins/amazonq/chat/jetbrains-community/resources/META-INF/plugin-chat.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
factoryClass="software.aws.toolkits.jetbrains.services.amazonq.toolwindow.AmazonQToolWindowFactory" icon="AwsIcons.Logos.AWS_Q" />
2121

2222
<postStartupActivity implementation="software.aws.toolkits.jetbrains.services.amazonq.startup.AmazonQStartupActivity"/>
23+
<actionPromoter order="last" implementation="software.aws.toolkits.jetbrains.services.cwc.inline.InlineChatActionPromoter"/>
2324
</extensions>
2425

2526
<extensions defaultExtensionNs="amazon.q">
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
// Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
// SPDX-License-Identifier: Apache-2.0
3+
4+
package software.aws.toolkits.jetbrains.services.cwc.inline
5+
6+
import com.intellij.openapi.actionSystem.ActionPromoter
7+
import com.intellij.openapi.actionSystem.AnAction
8+
import com.intellij.openapi.actionSystem.CommonDataKeys
9+
import com.intellij.openapi.actionSystem.DataContext
10+
import com.intellij.openapi.keymap.KeymapUtil
11+
import com.intellij.openapi.util.SystemInfo
12+
13+
class InlineChatActionPromoter : ActionPromoter {
14+
// temporary until we find a better key binding
15+
override fun promote(actions: MutableList<out AnAction>, context: DataContext): MutableList<AnAction> {
16+
val results = actions.toMutableList()
17+
if (context.getData(CommonDataKeys.EDITOR) == null ||
18+
context.getData(CommonDataKeys.PROJECT) == null
19+
) {
20+
return results
21+
}
22+
val shortCut = KeymapUtil.getShortcutText("aws.toolkit.jetbrains.core.services.cwc.inline.openChat")
23+
// only promote for the default key bindings
24+
if (SystemInfo.isMac && shortCut != "⌘I") return results
25+
if (!SystemInfo.isMac && shortCut != "Ctrl+I") return results
26+
27+
results.sortWith { a, b ->
28+
when {
29+
isOpenChatInputAction(a) -> -1
30+
isOpenChatInputAction(b) -> 1
31+
else -> 0
32+
}
33+
}
34+
return results
35+
}
36+
37+
private fun isOpenChatInputAction(action: AnAction): Boolean =
38+
action is OpenChatInputAction
39+
}

plugins/amazonq/chat/jetbrains-community/src/software/aws/toolkits/jetbrains/services/cwc/inline/InlineChatEditorHint.kt

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import com.intellij.codeInsight.hint.HintUtil
88
import com.intellij.openapi.editor.Editor
99
import com.intellij.openapi.editor.VisualPosition
1010
import com.intellij.openapi.keymap.KeymapUtil
11-
import com.intellij.openapi.util.SystemInfo
1211
import com.intellij.ui.LightweightHint
1312
import com.intellij.ui.SimpleColoredText
1413
import com.intellij.ui.SimpleTextAttributes
@@ -68,15 +67,9 @@ class InlineChatEditorHint {
6867
coloredText.appendToComponent(component)
6968
val shortcutComponent = HintUtil.createInformationComponent()
7069
val shortCut = KeymapUtil.getShortcutText("aws.toolkit.jetbrains.core.services.cwc.inline.openChat")
71-
if (!SystemInfo.isWindows && shortCut == "⌃I") {
72-
val shortCutIcon = AwsIcons.Resources.InlineChat.AWS_Q_INLINECHAT_SHORTCUT
73-
shortcutComponent.isIconOnTheRight = true
74-
shortcutComponent.icon = shortCutIcon
75-
} else {
76-
val shortcutText =
77-
SimpleColoredText(shortCut, SimpleTextAttributes.REGULAR_ATTRIBUTES)
78-
shortcutText.appendToComponent(shortcutComponent)
79-
}
70+
val shortcutText =
71+
SimpleColoredText(shortCut, SimpleTextAttributes.REGULAR_ATTRIBUTES)
72+
shortcutText.appendToComponent(shortcutComponent)
8073

8174
val panel = JPanel(BorderLayout()).apply {
8275
add(component, BorderLayout.WEST)

plugins/amazonq/codewhisperer/jetbrains-community/src/software/aws/toolkits/jetbrains/services/codewhisperer/credentials/CodeWhispererClientAdaptor.kt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -332,9 +332,7 @@ open class CodeWhispererClientAdaptorImpl(override val project: Project) : CodeW
332332
it.sessionId(responseContext.sessionId)
333333
it.recommendationLatencyMilliseconds(e2eLatency)
334334
it.triggerToResponseLatencyMilliseconds(requestContext.latencyContext.paginationFirstCompletionTime)
335-
it.perceivedLatencyMilliseconds(
336-
requestContext.latencyContext.getPerceivedLatency(requestContext.triggerTypeInfo.triggerType)
337-
)
335+
it.perceivedLatencyMilliseconds(requestContext.latencyContext.perceivedLatency)
338336
it.suggestionState(suggestionState.toCodeWhispererSdkType())
339337
it.timestamp(Instant.now())
340338
it.suggestionReferenceCount(suggestionReferenceCount)
@@ -380,6 +378,7 @@ open class CodeWhispererClientAdaptorImpl(override val project: Project) : CodeW
380378
it.sessionId(responseContext.sessionId)
381379
it.recommendationLatencyMilliseconds(e2eLatency)
382380
it.triggerToResponseLatencyMilliseconds(sessionContext.latencyContext.paginationFirstCompletionTime)
381+
it.perceivedLatencyMilliseconds(sessionContext.latencyContext.perceivedLatency)
383382
it.suggestionState(suggestionState.toCodeWhispererSdkType())
384383
it.timestamp(Instant.now())
385384
it.suggestionReferenceCount(suggestionReferenceCount)

0 commit comments

Comments
 (0)