Skip to content
Merged
Show file tree
Hide file tree
Changes from 10 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" : "bugfix",
"description" : "/test syntax highlighting when viewing diff"
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
"description" : "/test syntax highlighting when viewing diff"
"description" : "Enable syntax highlighting when viewing diff for /test"

}
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import com.intellij.openapi.project.guessProjectDir
import com.intellij.openapi.vfs.LocalFileSystem
import com.intellij.openapi.vfs.VirtualFile
import com.intellij.openapi.vfs.VirtualFileManager
import com.intellij.testFramework.LightVirtualFile
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.currentCoroutineContext
import kotlinx.coroutines.delay
Expand Down Expand Up @@ -458,6 +459,8 @@ class CodeTestChatController(
when (message.actionID) {
"utg_view_diff" -> {
withContext(EDT) {
val virtualFile = LightVirtualFile(session.testFileName)

(DiffManager.getInstance() as DiffManagerEx).showDiffBuiltin(
context.project,
SimpleDiffRequest(
Expand All @@ -466,9 +469,13 @@ class CodeTestChatController(
getFileContentAtTestFilePath(
session.projectRoot,
session.testFileRelativePathToProjectRoot
)
),
virtualFile
),
DiffContentFactory.getInstance().create(
session.generatedTestDiffs.values.first(),
virtualFile
),
DiffContentFactory.getInstance().create(session.generatedTestDiffs.values.first()),
"Before",
"After"
)
Expand Down
Loading