Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import org.eclipse.lsp4j.jsonrpc.services.JsonRequest
import org.eclipse.lsp4j.services.LanguageClient
import software.aws.toolkits.jetbrains.services.amazonq.lsp.model.aws.LSPAny
import software.aws.toolkits.jetbrains.services.amazonq.lsp.model.aws.chat.CHAT_OPEN_TAB
import software.aws.toolkits.jetbrains.services.amazonq.lsp.model.aws.chat.CHAT_OPTIONS_UPDATE_NOTIFICATION
import software.aws.toolkits.jetbrains.services.amazonq.lsp.model.aws.chat.CHAT_SEND_CONTEXT_COMMANDS
import software.aws.toolkits.jetbrains.services.amazonq.lsp.model.aws.chat.CHAT_SEND_UPDATE
import software.aws.toolkits.jetbrains.services.amazonq.lsp.model.aws.chat.CopyFileParams
Expand Down Expand Up @@ -67,4 +68,7 @@ interface AmazonQLanguageClient : LanguageClient {

@JsonNotification(DID_CREATE_DIRECTORY)
fun createDirectory(params: FileParams)

@JsonNotification(CHAT_OPTIONS_UPDATE_NOTIFICATION)
fun sendChatOptionsUpdate(params: LSPAny)
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
import software.aws.toolkits.jetbrains.services.amazonq.lsp.flareChat.FlareUiMessage
import software.aws.toolkits.jetbrains.services.amazonq.lsp.model.aws.LSPAny
import software.aws.toolkits.jetbrains.services.amazonq.lsp.model.aws.chat.CHAT_OPEN_TAB
import software.aws.toolkits.jetbrains.services.amazonq.lsp.model.aws.chat.CHAT_OPTIONS_UPDATE_NOTIFICATION
import software.aws.toolkits.jetbrains.services.amazonq.lsp.model.aws.chat.CHAT_SEND_CONTEXT_COMMANDS
import software.aws.toolkits.jetbrains.services.amazonq.lsp.model.aws.chat.CHAT_SEND_UPDATE
import software.aws.toolkits.jetbrains.services.amazonq.lsp.model.aws.chat.CopyFileParams
Expand Down Expand Up @@ -413,6 +414,16 @@
return refreshVfs(params.newPath)
}

override fun sendChatOptionsUpdate(params: LSPAny) {
Copy link
Contributor

@leigaol leigaol Jun 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this actually trigger the new code path that is supposed to be behind feature flag

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One alternative is just to suppress the warning

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it sends an empty payload so the seems pointless but safe

2025-06-02 16:46:36,111 [ 181028]   INFO - software.aws.toolkits.jetbrains.services.amazonq.lsp.AmazonQServerInstance - [Trace - 04:46:36 PM] Received notification 'aws/chat/chatOptionsUpdate'
Params: {
  "tabId": "c70vdc"
}

val chatManager = ChatCommunicationManager.getInstance(project)
chatManager.notifyUi(
FlareUiMessage(
command = CHAT_OPTIONS_UPDATE_NOTIFICATION,
params = params,

Check warning on line 422 in plugins/amazonq/shared/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/lsp/AmazonQLanguageClientImpl.kt

View check run for this annotation

Codecov / codecov/patch

plugins/amazonq/shared/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/lsp/AmazonQLanguageClientImpl.kt#L418-L422

Added lines #L418 - L422 were not covered by tests
)
)
}

Check warning on line 425 in plugins/amazonq/shared/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/lsp/AmazonQLanguageClientImpl.kt

View check run for this annotation

Codecov / codecov/patch

plugins/amazonq/shared/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/lsp/AmazonQLanguageClientImpl.kt#L425

Added line #L425 was not covered by tests

private fun refreshVfs(path: String) {
val currPath = Paths.get(path)
if (currPath.startsWith(localHistoryPath)) return
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ const val CHAT_INSERT_TO_CURSOR_NOTIFICATION = "aws/chat/insertToCursorPosition"
const val CHAT_LINK_CLICK = "aws/chat/linkClick"
const val CHAT_LIST_CONVERSATIONS = "aws/chat/listConversations"
const val CHAT_OPEN_TAB = "aws/chat/openTab"
const val CHAT_OPTIONS_UPDATE_NOTIFICATION = "aws/chat/chatOptionsUpdate"
const val CHAT_PROMPT_OPTION_ACKNOWLEDGED = "chatPromptOptionAcknowledged"
const val CHAT_QUICK_ACTION = "aws/chat/sendChatQuickAction"
const val CHAT_READY = "aws/chat/ready"
Expand Down
Loading