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
@@ -0,0 +1,4 @@
{
"type" : "feature",
"description" : "/review: Code fix automatically scrolls into view after generation."
}
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ internal class CodeWhispererCodeScanIssueDetailsPanel(
)
editorPane.revalidate()
editorPane.repaint()
runInEdt {
editorPane.scrollToReference("fixLoadingSection")
}

val codeFixResponse: AmazonQCodeFixSession.CodeFixResponse = amazonQCodeFixSession.runCodeFixWorkflow(issue)
if (codeFixResponse.failureResponse != null) {
Expand All @@ -81,6 +84,9 @@ internal class CodeWhispererCodeScanIssueDetailsPanel(
)
revalidate()
repaint()
runInEdt {
scrollToReference("fixFailureSection")
}
}
} else {
val isReferenceAllowed = CodeWhispererSettings.getInstance().isIncludeCodeWithReference()
Expand Down Expand Up @@ -115,6 +121,9 @@ internal class CodeWhispererCodeScanIssueDetailsPanel(
)
revalidate()
repaint()
runInEdt {
scrollToReference("codeFixActions")
}
}

buttonPane.apply {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ fun getCodeScanIssueDetailsHtml(
}

val fixLoadingSection = """
<a name="fixLoadingSection"></a>
<div align="center" bgcolor="#2b2b2b" style="margin: 20px;">
<font size="7" color="#ffffff" face="Arial">
&nbsp;&nbsp;&nbsp;&nbsp;...&nbsp;&nbsp;&nbsp;&nbsp;
Expand All @@ -145,6 +146,7 @@ fun getCodeScanIssueDetailsHtml(
""".trimIndent()

val fixFailureSection = """
<a name="fixFailureSection"></a>
<div align="center" bgcolor="#2b2b2b" style="margin: 20px;">
<font size="4" color="#e6e6e6" face="Arial">
<br>Amazon Q failed to generate fix. Please try again<br>
Expand Down Expand Up @@ -192,6 +194,7 @@ private fun createSuggestedFixSection(issue: CodeWhispererCodeScanIssue, suggest
|${it.code.trim()}
|```
|</div>
|<a name="codeFixActions"></a>
|<div>
| <a href="amazonq://issue/openDiff-${issue.findingId}">
| <font size="+1"><i>&#x2194;</i></font> <b>Open Diff</b>
Expand Down
Loading