Skip to content

Commit

Permalink
Refactor OrionTemplateDiffEditorProvider
Browse files Browse the repository at this point in the history
  • Loading branch information
GunniBusch committed Dec 11, 2023
1 parent 59810e3 commit f7dc39c
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
@file:Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
//@file:Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
package de.tum.www1.orion.ui.assessment

import com.intellij.diff.DiffRequestFactory
import com.intellij.diff.editor.DiffEditorProvider
import com.intellij.diff.editor.DiffRequestProcessorEditor
import com.intellij.diff.editor.DiffVirtualFile
import com.intellij.diff.editor.SimpleDiffVirtualFile
import com.intellij.openapi.fileEditor.FileEditor
import com.intellij.openapi.fileEditor.FileEditorPolicy
Expand Down Expand Up @@ -36,8 +37,9 @@ class OrionTemplateDiffEditorProvider : OrionEditorProvider() {

val request = DiffRequestFactory.getInstance().createFromFiles(project, studentFile, templateFile)
val diffFile = SimpleDiffVirtualFile(request)

return DiffEditorProvider().createEditor(project, diffFile)
// Copy from DiffEditorProvider
val processor = (diffFile as DiffVirtualFile).createProcessor(project)
return DiffRequestProcessorEditor(diffFile, processor)
}

override fun getEditorTypeId(): String = "ORION TEMPLATE DIFF EDITOR"
Expand Down

0 comments on commit f7dc39c

Please sign in to comment.