Skip to content

Commit 79ea537

Browse files
committed
fix context transparency list to make it work
1 parent fdcae23 commit 79ea537

File tree

4 files changed

+36
-9
lines changed

4 files changed

+36
-9
lines changed

plugins/amazonq/chat/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/webview/BrowserConnector.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,7 @@ class BrowserConnector(
239239
chatPrompt,
240240
textDocumentIdentifier,
241241
cursorState,
242+
context = requestFromUi.params.context
242243
)
243244

244245
val tabId = requestFromUi.params.tabId

plugins/amazonq/shared/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/lsp/flareChat/AwsServerCapabilitiesProvider.kt

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ package software.aws.toolkits.jetbrains.services.amazonq.lsp.flareChat
66
import com.intellij.openapi.components.Service
77
import com.intellij.openapi.components.service
88
import com.intellij.openapi.project.Project
9+
import software.aws.toolkits.jetbrains.services.amazonq.lsp.model.aws.chat.IconType
910

1011
@Service(Service.Level.PROJECT)
1112
class AwsServerCapabilitiesProvider {
@@ -25,8 +26,8 @@ class AwsServerCapabilitiesProvider {
2526
listOf(
2627
QuickActionsCommandGroups(
2728
listOf(
28-
Command("/help", "Learn more about Amazon Q then"),
29-
Command("/clear", "Clear this session")
29+
QuickActionCommand("/help", "Learn more about Amazon Q then"),
30+
QuickActionCommand("/clear", "Clear this session")
3031
)
3132
)
3233
)
@@ -52,10 +53,33 @@ data class QuickActions(
5253
)
5354

5455
data class QuickActionsCommandGroups(
55-
val commands: List<Command>,
56+
val commands: List<QuickActionCommand>,
5657
)
5758

58-
data class Command(
59-
val command: String,
60-
val description: String?,
59+
open class QuickActionCommand(
60+
open val command: String,
61+
open val description: String,
62+
open val placeholder: String? = null,
63+
open val icon: IconType? = null,
64+
)
65+
66+
data class ContextCommand(
67+
val id: String?,
68+
val route: List<String>?,
69+
val label: String?,
70+
val children: ContextCommandGroup?,
71+
override val command: String,
72+
override val description: String,
73+
override val placeholder: String? = null,
74+
override val icon: IconType? = null,
75+
) : QuickActionCommand(
76+
command = command,
77+
description = description,
78+
placeholder = placeholder,
79+
icon = icon
80+
)
81+
82+
data class ContextCommandGroup(
83+
val groupName: String?,
84+
val commands: List<ContextCommand>,
6185
)

plugins/amazonq/shared/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/lsp/model/aws/chat/ChatPrompt.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
package software.aws.toolkits.jetbrains.services.amazonq.lsp.model.aws.chat
55

66
import com.fasterxml.jackson.annotation.JsonProperty
7-
import software.aws.toolkits.jetbrains.services.amazonq.lsp.flareChat.Command
7+
import software.aws.toolkits.jetbrains.services.amazonq.lsp.flareChat.ContextCommand
88

99
data class ChatPrompt(
1010
val prompt: String,
@@ -20,13 +20,13 @@ data class SendChatPromptRequest(
2020
data class MidChatPrompt(
2121
val prompt: InnerChatPrompt,
2222
val tabId: String,
23-
val context: List<Command>?,
23+
val context: List<ContextCommand>?,
2424
)
2525

2626
data class InnerChatPrompt(
2727
val prompt: String,
2828
val escapedPrompt: String,
29-
val context: List<Command>? = null,
29+
val context: List<ContextCommand>? = null,
3030
val options: InnerChatOptions?,
3131
)
3232

plugins/amazonq/shared/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/lsp/model/aws/chat/SendChatPrompt.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,14 @@
44
package software.aws.toolkits.jetbrains.services.amazonq.lsp.model.aws.chat
55

66
import org.eclipse.lsp4j.TextDocumentIdentifier
7+
import software.aws.toolkits.jetbrains.services.amazonq.lsp.flareChat.ContextCommand
78

89
data class ChatParams(
910
val tabId: String,
1011
val prompt: ChatPrompt,
1112
val textDocument: TextDocumentIdentifier,
1213
val cursorState: CursorState,
14+
val context: List<ContextCommand>?,
1315
)
1416

1517
data class EncryptedChatParams(

0 commit comments

Comments
 (0)