Skip to content

Commit 3ffe4e9

Browse files
committed
fix: send cursorState as array to match LSP server ChatParams interface
The LSP server expects cursorState to be CursorState[] (array), but JetBrains was sending it as a single object. This caused the server to fall back to default cursor state when accessing cursorState?.[0] on a non-array value. Fixes selection detection when user types directly in chat panel.
1 parent 25560ed commit 3ffe4e9

File tree

1 file changed

+1
-1
lines changed
  • plugins/amazonq/chat/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/webview

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ class BrowserConnector(
241241

242242
val enrichmentParams = mapOf(
243243
"textDocument" to textDocumentIdentifier,
244-
"cursorState" to cursorState,
244+
"cursorState" to cursorState?.let { listOf(it) },
245245
)
246246

247247
val serializedEnrichmentParams = serializer.objectMapper.valueToTree<ObjectNode>(enrichmentParams)

0 commit comments

Comments
 (0)