You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(amazonq): enable syntax highlighting when viewing diff for generated unit tests (#5337)
* enable syntax highlighting when viewing diff for generated unit tests
changelog
remove unused import
* lint
* virtualFile always created and will not be null
* use session.testFileName instead of extension
* lint
* create temporary virtual file
* comment
* Update bugfix-3b7843b4-9673-4afa-90e8-7c4278f0d0fe.json
Copy file name to clipboardExpand all lines: plugins/amazonq/chat/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonqCodeTest/controller/CodeTestChatController.kt
+11-2Lines changed: 11 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -458,6 +458,10 @@ class CodeTestChatController(
458
458
when (message.actionID) {
459
459
"utg_view_diff"-> {
460
460
withContext(EDT) {
461
+
// virtual file only needed for syntax highlighting when viewing diff
462
+
val tempPath =Files.createTempFile(null, ".${session.testFileName.substringAfterLast('.')}")
463
+
val virtualFile = tempPath.toFile().toVirtualFile()
0 commit comments