Skip to content

Commit 893f5f8

Browse files
committed
merge conflict
2 parents 1ffdd70 + a834c96 commit 893f5f8

File tree

17 files changed

+581
-91
lines changed

17 files changed

+581
-91
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"type" : "bugfix",
3+
"description" : "Improve the position that inline chat shortcut hint is shown in editor"
4+
}

package-lock.json

Lines changed: 229 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"dependencies": {
3+
"node": "^22.9.0",
4+
"vue-select": "^3.20.3"
5+
},
6+
"devDependencies": {
7+
"@types/vue-select": "^3.16.8"
8+
}
9+
}

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

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,23 +19,26 @@ import javax.swing.JPanel
1919

2020
class InlineChatEditorHint {
2121
private val hint = createHint()
22+
private val hintXOffset = 20
2223

2324
private fun getHintLocation(editor: Editor): Point {
2425
val range = editor.calculateVisibleRange()
2526
val document = editor.document
2627
val selectionEnd = editor.selectionModel.selectionEnd
2728
val isOneLineSelection = isOneLineSelection(editor)
28-
val isBelow = editor.offsetToXY(selectionEnd) !in editor.scrollingModel.visibleArea
29+
val offset = document.getLineEndOffset(document.getLineNumber(selectionEnd))
30+
val offsetXy = editor.offsetToXY(offset)
31+
val potentialXy = Point(offsetXy.x + hintXOffset, offsetXy.y)
32+
val isBelow = potentialXy !in editor.scrollingModel.visibleArea
2933
val areEdgesOutsideOfVisibleArea = editor.selectionModel.selectionStart !in range && editor.selectionModel.selectionEnd !in range
3034
val offsetForHint = when {
31-
isOneLineSelection -> selectionEnd
3235
areEdgesOutsideOfVisibleArea -> document.getLineEndOffset(getLineByVisualStart(editor, editor.caretModel.offset, true))
3336
isBelow -> document.getLineEndOffset(getLineByVisualStart(editor, selectionEnd, true))
3437
else -> document.getLineEndOffset(getLineByVisualStart(editor, selectionEnd, false))
3538
}
3639
val visualPosition = editor.offsetToVisualPosition(offsetForHint)
37-
val hintPoint = HintManagerImpl.getHintPosition(hint, editor, visualPosition, HintManager.RIGHT)
38-
hintPoint.translate(0, if (isBelow) editor.lineHeight else 0)
40+
val hintPoint = HintManagerImpl.getHintPosition(hint, editor, visualPosition, HintManager.RIGHT_UNDER)
41+
hintPoint.translate(if (!isBelow) hintXOffset else 0, if (!isOneLineSelection || isBelow) editor.lineHeight else 0)
3942
return hintPoint
4043
}
4144

plugins/core/jetbrains-community/resources/telemetryOverride.json

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -755,25 +755,6 @@
755755
],
756756
"passive": true
757757
},
758-
{
759-
"name": "auth_userState",
760-
"description": "The state of the user's authentication.",
761-
"metadata": [
762-
{
763-
"type": "source",
764-
"required": true
765-
},
766-
{
767-
"type": "authStatus",
768-
"required": true
769-
},
770-
{
771-
"type": "authEnabledConnections",
772-
"required": true
773-
}
774-
],
775-
"passive": true
776-
},
777758
{
778759
"name": "webview_amazonqSignInOpened",
779760
"description": "Called when a Amazon Q sign in webview is opened.",

0 commit comments

Comments
 (0)