-
Notifications
You must be signed in to change notification settings - Fork 273
deps(amazonq): client handles openTab requests from server #5630
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
Changes from 4 commits
08627c1
51ee404
f3fdda9
dcab88d
74f5e09
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,127 @@ | ||
| // Copyright 2025 Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
| // SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| package software.aws.toolkits.jetbrains.services.amazonq.lsp.model.aws.chat | ||
|
|
||
| data class ChatMessage( | ||
| val type: MessageType? = MessageType.ANSWER, | ||
| val header: MessageHeader? = null, | ||
| val buttons: List<Button>? = null, | ||
| val body: String? = null, | ||
| val messageId: String? = null, | ||
| val canBeVoted: Boolean? = null, | ||
| val relatedContent: RelatedContent? = null, | ||
| val followUp: FollowUp? = null, | ||
| val codeReference: List<ReferenceTrackerInformation>? = null, | ||
| val fileList: FileList? = null, | ||
| val contextList: FileList? = null, | ||
| ) | ||
|
Check warning on line 18 in plugins/amazonq/shared/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/lsp/model/aws/chat/ChatMessage.kt
|
||
|
|
||
| data class MessageHeader( | ||
| val type: MessageType? = MessageType.ANSWER, | ||
| val buttons: List<Button>? = null, | ||
| val body: String? = null, | ||
| val messageId: String? = null, | ||
| val canBeVoted: Boolean? = null, | ||
| val relatedContent: RelatedContent? = null, | ||
| val followUp: FollowUp? = null, | ||
| val codeReference: List<ReferenceTrackerInformation>? = null, | ||
| val fileList: FileList? = null, | ||
| val contextList: FileList? = null, | ||
| val icon: IconType? = null, | ||
| val status: MessageStatus? = null, | ||
| ) | ||
|
Check warning on line 33 in plugins/amazonq/shared/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/lsp/model/aws/chat/ChatMessage.kt
|
||
|
|
||
| data class MessageStatus( | ||
| val status: Status? = null, | ||
| val icon: IconType? = null, | ||
| val text: String? = null, | ||
| ) | ||
|
Check warning on line 39 in plugins/amazonq/shared/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/lsp/model/aws/chat/ChatMessage.kt
|
||
|
|
||
| data class Button( | ||
| val id: String, | ||
| val text: String? = null, | ||
| val description: String? = null, | ||
| val icon: IconType? = null, | ||
| val disabled: Boolean? = null, | ||
| val keepCardAfterClick: Boolean? = null, | ||
| val status: ButtonStatus? = null, | ||
| ) | ||
|
Check warning on line 49 in plugins/amazonq/shared/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/lsp/model/aws/chat/ChatMessage.kt
|
||
|
|
||
| data class FileList( | ||
| val rootFolderTitle: String? = null, | ||
| val filePaths: List<String>? = null, | ||
| val deletedFiles: List<String>? = null, | ||
| val details: Map<String, FileDetails>? = null, | ||
| ) | ||
|
Check warning on line 56 in plugins/amazonq/shared/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/lsp/model/aws/chat/ChatMessage.kt
|
||
|
|
||
| data class FileDetails( | ||
| val description: String? = null, | ||
| val lineRanges: List<Pair<Int, Int>>? = null, | ||
| val changes: Changes? = null, | ||
| ) | ||
|
Check warning on line 62 in plugins/amazonq/shared/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/lsp/model/aws/chat/ChatMessage.kt
|
||
|
|
||
| data class Changes( | ||
| val added: Int? = null, | ||
| val deleted: Int? = null, | ||
| val total: Int? = null, | ||
| ) | ||
|
Check warning on line 68 in plugins/amazonq/shared/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/lsp/model/aws/chat/ChatMessage.kt
|
||
|
|
||
| enum class IconType { | ||
| FILE, | ||
| FOLDER, | ||
| CODE_BLOCK, | ||
| LIST_ADD, | ||
| MAGIC, | ||
| HELP, | ||
| TRASH, | ||
| SEARCH, | ||
| CALENDAR, | ||
|
Check warning on line 79 in plugins/amazonq/shared/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/lsp/model/aws/chat/ChatMessage.kt
|
||
| ; | ||
|
|
||
| val value: String | ||
| get() = name.lowercase().replace('_', '-') | ||
|
Check warning on line 83 in plugins/amazonq/shared/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/lsp/model/aws/chat/ChatMessage.kt
|
||
|
|
||
| companion object { | ||
| private val stringToEnum: Map<String, IconType> = entries.associateBy { it.name.lowercase() } | ||
|
Check warning on line 86 in plugins/amazonq/shared/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/lsp/model/aws/chat/ChatMessage.kt
|
||
|
|
||
| fun fromString(value: String): IconType = stringToEnum[value] ?: throw IllegalArgumentException("Unknown IconType: $value") | ||
| } | ||
| } | ||
|
Check warning on line 90 in plugins/amazonq/shared/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/lsp/model/aws/chat/ChatMessage.kt
|
||
|
|
||
| enum class Status { | ||
| INFO, | ||
Check warningCode scanning / QDJVMC Unused symbol Warning
Class "INFO" is never used
|
||
| SUCCESS, | ||
Check warningCode scanning / QDJVMC Unused symbol Warning
Class "SUCCESS" is never used
|
||
| WARNING, | ||
Check warningCode scanning / QDJVMC Unused symbol Warning
Class "WARNING" is never used
|
||
| ERROR, | ||
|
Check warning on line 96 in plugins/amazonq/shared/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/lsp/model/aws/chat/ChatMessage.kt
|
||
Check warningCode scanning / QDJVMC Unused symbol Warning
Class "ERROR" is never used
|
||
| ; | ||
|
|
||
| val value: String | ||
| get() = name.lowercase() | ||
| } | ||
|
Check warning on line 101 in plugins/amazonq/shared/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/lsp/model/aws/chat/ChatMessage.kt
|
||
|
|
||
| enum class ButtonStatus { | ||
| MAIN, | ||
Check warningCode scanning / QDJVMC Unused symbol Warning
Class "MAIN" is never used
|
||
| PRIMARY, | ||
Check warningCode scanning / QDJVMC Unused symbol Warning
Class "PRIMARY" is never used
|
||
| CLEAR, | ||
Check warningCode scanning / QDJVMC Unused symbol Warning
Class "CLEAR" is never used
|
||
| INFO, | ||
Check warningCode scanning / QDJVMC Unused symbol Warning
Class "INFO" is never used
|
||
| SUCCESS, | ||
Check warningCode scanning / QDJVMC Unused symbol Warning
Class "SUCCESS" is never used
|
||
| WARNING, | ||
Check warningCode scanning / QDJVMC Unused symbol Warning
Class "WARNING" is never used
|
||
| ERROR, | ||
|
Check warning on line 110 in plugins/amazonq/shared/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/lsp/model/aws/chat/ChatMessage.kt
|
||
Check warningCode scanning / QDJVMC Unused symbol Warning
Class "ERROR" is never used
|
||
| ; | ||
|
|
||
| val value: String | ||
| get() = name.lowercase() | ||
| } | ||
|
Check warning on line 115 in plugins/amazonq/shared/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/lsp/model/aws/chat/ChatMessage.kt
|
||
|
|
||
| enum class MessageType { | ||
| ANSWER, | ||
| PROMPT, | ||
Check warningCode scanning / QDJVMC Unused symbol Warning
Class "PROMPT" is never used
|
||
| SYSTEM_PROMPT, | ||
Check warningCode scanning / QDJVMC Unused symbol Warning
Class "SYSTEM_PROMPT" is never used
|
||
| DIRECTIVE, | ||
Check warningCode scanning / QDJVMC Unused symbol Warning
Class "DIRECTIVE" is never used
|
||
| TOOL, | ||
|
Check warning on line 122 in plugins/amazonq/shared/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/lsp/model/aws/chat/ChatMessage.kt
|
||
Check warningCode scanning / QDJVMC Unused symbol Warning
Class "TOOL" is never used
|
||
| ; | ||
|
|
||
| val value: String | ||
| get() = name.lowercase().replace('_', '-') | ||
| } | ||
|
Check warning on line 127 in plugins/amazonq/shared/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/lsp/model/aws/chat/ChatMessage.kt
|
||
Check warning
Code scanning / QDJVMC
Unused symbol Warning