diff --git a/build.gradle.kts b/build.gradle.kts index 1251ef62..18cab052 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -26,7 +26,7 @@ repositories { val kotlin_version = "1.9.21" val jetty_version = "11.0.18" val slf4j_version = "2.0.9" -val skyenet_version = "1.0.59" +val skyenet_version = "1.0.60" val remoterobot_version = "0.11.21" dependencies { diff --git a/gradle.properties b/gradle.properties index aed6b865..f1b2e654 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,6 +1,6 @@ pluginName=intellij-aicoder pluginRepositoryUrl=https://github.com/SimiaCryptus/intellij-aicoder -pluginVersion=1.3.8 +pluginVersion=1.3.9 jvmArgs=-Xmx8g org.gradle.jvmargs=-Xmx8g diff --git a/src/main/kotlin/com/github/simiacryptus/aicoder/actions/generic/AnalogueFileAction.kt b/src/main/kotlin/com/github/simiacryptus/aicoder/actions/generic/AnalogueFileAction.kt index 87e7c995..bb6c90f2 100644 --- a/src/main/kotlin/com/github/simiacryptus/aicoder/actions/generic/AnalogueFileAction.kt +++ b/src/main/kotlin/com/github/simiacryptus/aicoder/actions/generic/AnalogueFileAction.kt @@ -113,7 +113,7 @@ class AnalogueFileAction : FileContextAction() { |The file should be based on `${baseFile.path}` which contains the following code: | |``` - |${baseFile.code?.let { /*escapeHtml4*/it.indent(" ") }} + |${baseFile.code?.let { /*escapeHtml4*/it/*.indent(" ")*/ }} |``` """.trimMargin().toContentList(), null ) diff --git a/src/main/kotlin/com/github/simiacryptus/aicoder/actions/generic/AutoDevAction.kt b/src/main/kotlin/com/github/simiacryptus/aicoder/actions/generic/AutoDevAction.kt index b232e8a2..e6533ab2 100644 --- a/src/main/kotlin/com/github/simiacryptus/aicoder/actions/generic/AutoDevAction.kt +++ b/src/main/kotlin/com/github/simiacryptus/aicoder/actions/generic/AutoDevAction.kt @@ -173,7 +173,7 @@ class AutoDevAction : BaseAction() { fun codeSummary() = codeFiles.entries.joinToString("\n\n") { (path, code) -> "# $path\n```${ path.split('.').last() - }\n${code.indent(" ")}\n```" + }\n${code/*.indent(" ")*/}\n```" } val task = ui.newTask() @@ -183,11 +183,11 @@ class AutoDevAction : BaseAction() { userMessage = userMessage, initialResponse = { it: String -> designActor.answer(toInput(it), api = api) }, outputFn = { design: ParsedResponse -> - // renderMarkdown("${design.text}\n\n```json\n${JsonUtil.toJson(design.obj).indent(" ")}\n```") + // renderMarkdown("${design.text}\n\n```json\n${JsonUtil.toJson(design.obj)/*.indent(" ")*/}\n```") AgentPatterns.displayMapInTabs( mapOf( - "Text" to renderMarkdown(design.text), - "JSON" to renderMarkdown("```json\n${toJson(design.obj).indent(" ")}\n```"), + "Text" to renderMarkdown(design.text, ui=ui), + "JSON" to renderMarkdown("```json\n${toJson(design.obj)/*.indent(" ")*/}\n```", ui=ui), ) ) }, @@ -207,7 +207,7 @@ class AutoDevAction : BaseAction() { try { architectureResponse.obj.tasks.forEach { (paths, description) -> - task.complete(ui.hrefLink(renderMarkdown("Task: $description")) { + task.complete(ui.hrefLink(renderMarkdown("Task: $description", ui=ui)) { val task = ui.newTask() task.header("Task: $description") val process = { it: StringBuilder -> @@ -235,8 +235,8 @@ class AutoDevAction : BaseAction() { userMessage, filter.entries.joinToString("\n\n") { "# ${it.key}\n```${ - it.key.split('.').last()?.let { /*escapeHtml4*/it.indent(" ") } - }\n${it.value.indent(" ")}\n```" + it.key.split('.').last()?.let { /*escapeHtml4*/it/*.indent(" ")*/ } + }\n${it.value/*.indent(" ")*/}\n```" }, architectureResponse.text, "Provide a change for ${paths?.joinToString(",") { it } ?: ""} ($description)" diff --git a/src/main/kotlin/com/github/simiacryptus/aicoder/actions/generic/DiffChatAction.kt b/src/main/kotlin/com/github/simiacryptus/aicoder/actions/generic/DiffChatAction.kt index 1bb8a622..18f5c756 100644 --- a/src/main/kotlin/com/github/simiacryptus/aicoder/actions/generic/DiffChatAction.kt +++ b/src/main/kotlin/com/github/simiacryptus/aicoder/actions/generic/DiffChatAction.kt @@ -15,6 +15,8 @@ import com.simiacryptus.skyenet.core.platform.ApplicationServices import com.simiacryptus.skyenet.core.platform.Session import com.simiacryptus.skyenet.core.platform.StorageInterface import com.simiacryptus.skyenet.core.platform.User +import com.simiacryptus.skyenet.set +import com.simiacryptus.skyenet.webui.application.ApplicationInterface import com.simiacryptus.skyenet.webui.application.ApplicationServer import com.simiacryptus.skyenet.webui.chat.ChatServer import com.simiacryptus.skyenet.webui.session.SessionTask @@ -84,12 +86,15 @@ class DiffChatAction : BaseAction() { Note: The diff should accurately reflect the changes to be made to the code, including sufficient context to ensure the modifications can be correctly applied. """.trimIndent() + val ui by lazy { ApplicationInterface(this) } override fun renderResponse(response: String, task: SessionTask): String { - val withLinks = addApplyDiffLinks(rawText, response, handle = { newCode: String -> + val codeBuffer = StringBuilder(rawText) + val withLinks = addApplyDiffLinks(codeBuffer, response, handle = { newCode: String -> WriteCommandAction.runWriteCommandAction(e.project) { - document.replaceString(selectionStart, selectionEnd, newCode) + document.replaceString(selectionStart, selectionStart + codeBuffer.length, newCode) } - }, task = task) + codeBuffer.set(newCode) + }, task = task, ui=ui) val html = renderMarkdown(withLinks) return """
$html
""" } diff --git a/src/main/kotlin/com/github/simiacryptus/aicoder/actions/generic/LineFilterChatAction.kt b/src/main/kotlin/com/github/simiacryptus/aicoder/actions/generic/LineFilterChatAction.kt index df3090ec..63b9ffff 100644 --- a/src/main/kotlin/com/github/simiacryptus/aicoder/actions/generic/LineFilterChatAction.kt +++ b/src/main/kotlin/com/github/simiacryptus/aicoder/actions/generic/LineFilterChatAction.kt @@ -44,7 +44,7 @@ class LineFilterChatAction : BaseAction() { |# `$filename` | |```$language - |${code?.let { /*escapeHtml4*/(it).indent(" ") }} + |${code?.let { /*escapeHtml4*/(it)/*.indent(" ")*/ }} |``` """.trimMargin().trim(), systemPrompt = """ @@ -53,7 +53,7 @@ class LineFilterChatAction : BaseAction() { |You will be answering questions about the following code located in `$filename`: | |```$language - |${codelines?.let { /*escapeHtml4*/(it).indent(" ") }} + |${codelines?.let { /*escapeHtml4*/(it)/*.indent(" ")*/ }} |``` | |Responses may use markdown formatting. Lines from the prompt can be included by using the line number in a response line (e.g. `\nLINE\n`). diff --git a/src/main/kotlin/com/github/simiacryptus/aicoder/actions/generic/TaskRunnerAction.kt b/src/main/kotlin/com/github/simiacryptus/aicoder/actions/generic/TaskRunnerAction.kt index ec163234..442488ed 100644 --- a/src/main/kotlin/com/github/simiacryptus/aicoder/actions/generic/TaskRunnerAction.kt +++ b/src/main/kotlin/com/github/simiacryptus/aicoder/actions/generic/TaskRunnerAction.kt @@ -48,20 +48,6 @@ import java.util.concurrent.ThreadPoolExecutor import java.util.concurrent.atomic.AtomicReference import kotlin.reflect.KClass -/** - * The provided Kotlin code outlines a complex application designed for task planning and execution, integrating with a chat server and utilizing AI models for task breakdown, documentation generation, new file creation, file patching, and inquiries. The application leverages several components, including an IntelliJ plugin, a web UI, and AI-driven actors for processing user inputs and generating code or documentation. Below is a mermaid.js diagram that visualizes the high-level architecture and flow of this application. - * - * ### Key Components and Flow: - * - * - **TaskRunner**: Initiates the task planning process, interacts with the `AppServer` for web UI, selects files via `DataStorage`, and opens a browser window for user interaction. - * - **AppServer & TaskRunnerApp**: Hosts the application server and registers the `TaskRunnerApp` which manages sessions and settings. - * - **TaskRunnerAgent**: Acts as the central processor for user messages, utilizing an `ActorSystem` to delegate tasks to specific actors based on the task type. - * - **ActorSystem & Actors (TaskBreakdown, DocumentationGenerator, etc.)**: Processes user messages to perform specific actions like task breakdown, documentation generation, file creation, patching, and inquiries. - * - **Results (TaskBreakdownResult, Documentation, etc.)**: Outputs generated by the actors, which are used for further task planning, code documentation, file creation, or patching. - * - * This diagram and description provide a simplified overview of the application's architecture and logic flow. The actual implementation may involve more detailed interactions and components not fully captured here. - * - * */ class TaskRunnerAction : BaseAction() { val path = "/taskDev" @@ -295,7 +281,7 @@ class TaskRunnerAgent( model = model, temperature = temperature, ), - )+ (if (!shellCommandTaskEnabled) mapOf() else mapOf( + ) + (if (!shellCommandTaskEnabled) mapOf() else mapOf( ActorTypes.RunShellCommand to CodingActor( interpreterClass = ProcessInterpreter::class, details = """ @@ -408,7 +394,7 @@ class TaskRunnerAgent( """ |## $path | - |${(codeFiles[path.toString()] ?: "").let { "```\n${it.indent(" ")}\n```" }} + |${(codeFiles[path.toString()] ?: "").let { "```\n${it/*.indent(" ")*/}\n```" }} """.trimMargin() } } @@ -423,14 +409,14 @@ class TaskRunnerAgent( } val highLevelPlan = Acceptable( task = task, - heading = renderMarkdown(userMessage), + heading = renderMarkdown(userMessage, ui=ui), userMessage = userMessage, initialResponse = { it: String -> taskBreakdownActor.answer(toInput(it), api = api) }, outputFn = { design: ParsedResponse -> displayMapInTabs( mapOf( - "Text" to renderMarkdown(design.text), - "JSON" to renderMarkdown("```json\n${toJson(design.obj).indent(" ")}\n```"), + "Text" to renderMarkdown(design.text, ui=ui), + "JSON" to renderMarkdown("```json\n${toJson(design.obj)/*.indent(" ")*/}\n```", ui=ui), ) ) }, @@ -453,10 +439,10 @@ class TaskRunnerAgent( val genState = GenState(tasksByID.toMutableMap()) val diagramTask = ui.newTask() val diagramBuffer = - diagramTask.add(renderMarkdown("## Task Dependency Graph\n```mermaid\n${buildMermaidGraph(genState.subTasks)}\n```")) + diagramTask.add(renderMarkdown("## Task Dependency Graph\n```mermaid\n${buildMermaidGraph(genState.subTasks)}\n```", ui=ui)) val taskTabs = object : TabbedDisplay(ui.newTask()) { override fun renderTabButtons(): String { - diagramBuffer?.set(renderMarkdown("## Task Dependency Graph\n```mermaid\n${buildMermaidGraph(genState.subTasks)}\n```")) + diagramBuffer?.set(renderMarkdown("## Task Dependency Graph\n```mermaid\n${buildMermaidGraph(genState.subTasks)}\n```", ui=ui)) diagramTask.complete() return buildString { append("
\n") @@ -589,13 +575,13 @@ class TaskRunnerAgent( |${subTask.description ?: ""} | |```json - |${toJson(subTask).indent(" ")} + |${toJson(subTask)/*.indent(" ")*/} |``` | |### Dependencies: |${dependencies.joinToString("\n") { "- $it" }} | - """.trimMargin() + """.trimMargin(), ui=ui ) ) @@ -678,7 +664,7 @@ class TaskRunnerAgent( } TaskType.TaskPlanning -> { - if(taskPlanningEnabled) taskPlanning( + if (taskPlanningEnabled) taskPlanning( subTask = subTask, userMessage = userMessage, highLevelPlan = highLevelPlan, @@ -740,49 +726,49 @@ class TaskRunnerAgent( taskTabs: TabbedDisplay, function: () -> Unit ) { - object : CodingAgent( - api = api, - dataStorage = dataStorage, - session = session, - user = user, - ui = ui, - interpreter = shellCommandActor.interpreterClass as KClass, - symbols = shellCommandActor.symbols, - temperature = shellCommandActor.temperature, - details = shellCommandActor.details, - model = shellCommandActor.model, + object : CodingAgent( + api = api, + dataStorage = dataStorage, + session = session, + user = user, + ui = ui, + interpreter = shellCommandActor.interpreterClass as KClass, + symbols = shellCommandActor.symbols, + temperature = shellCommandActor.temperature, + details = shellCommandActor.details, + model = shellCommandActor.model, + ) { + override fun displayFeedback( + task: SessionTask, + request: CodingActor.CodeRequest, + response: CodingActor.CodeResult ) { - override fun displayFeedback( - task: SessionTask, - request: CodingActor.CodeRequest, - response: CodingActor.CodeResult - ) { - val formText = StringBuilder() - var formHandle: StringBuilder? = null - formHandle = task.add( - """ + val formText = StringBuilder() + var formHandle: StringBuilder? = null + formHandle = task.add( + """ |
|${if (!super.canPlay) "" else super.playButton(task, request, response, formText) { formHandle!! }} |${acceptButton(task, request, response, formText) { formHandle!! }} |
|${super.reviseMsg(task, request, response, formText) { formHandle!! }} """.trimMargin(), className = "reply-message" - ) - formText.append(formHandle.toString()) - formHandle.toString() - task.complete() - } + ) + formText.append(formHandle.toString()) + formHandle.toString() + task.complete() + } fun acceptButton( - task: SessionTask, - request: CodingActor.CodeRequest, - response: CodingActor.CodeResult, - formText: StringBuilder, - formHandle: () -> StringBuilder - ): String { + task: SessionTask, + request: CodingActor.CodeRequest, + response: CodingActor.CodeResult, + formText: StringBuilder, + formHandle: () -> StringBuilder + ): String { return ui.hrefLink("\uD83D\uDC4D", "href-link play-button") { - genState.taskResult[taskId] = response.let { - """ + genState.taskResult[taskId] = response.let { + """ |## Shell Command Output | |``` @@ -793,17 +779,21 @@ class TaskRunnerAgent( |${response.renderedResponse} |``` """.trimMargin() - } - function() } + function() } + } }.apply { - start(codeRequest(listOf( - userMessage to Role.user, - highLevelPlan.text to Role.assistant, - priorCode to Role.assistant, - inputFileCode to Role.assistant, - ))) + start( + codeRequest( + listOf( + userMessage to Role.user, + highLevelPlan.text to Role.assistant, + priorCode to Role.assistant, + inputFileCode to Role.assistant, + ) + ) + ) } } @@ -841,7 +831,7 @@ class TaskRunnerAgent( } else { task.complete("No changes to $path") } - }) + accept(sb) { + }, ui=ui) + accept(sb) { taskTabs.selectedTab = taskTabs.selectedTab + 1 taskTabs.update() onComplete() @@ -905,7 +895,7 @@ class TaskRunnerAgent( taskTabs.update() task.complete() onComplete() - }) + }, ui=ui) } object : Retryable(ui, task, process) { init { @@ -935,7 +925,7 @@ class TaskRunnerAgent( ).filter { it.isNotBlank() }, api ) genState.taskResult[taskId] = docResult - renderMarkdown("## Generated Documentation\n$docResult") + accept(sb) { + renderMarkdown("## Generated Documentation\n$docResult", ui=ui) + accept(sb) { taskTabs.selectedTab = taskTabs.selectedTab + 1 taskTabs.update() task.complete() @@ -995,7 +985,7 @@ class TaskRunnerAgent( heading = "", initialResponse = { it: String -> inquiryActor.answer(toInput(it), api = api) }, outputFn = { design: String -> - renderMarkdown(design) + renderMarkdown(design, ui=ui) }, ui = ui, reviseResponse = { userMessages: List> -> @@ -1041,8 +1031,8 @@ class TaskRunnerAgent( outputFn = { design: ParsedResponse -> displayMapInTabs( mapOf( - "Text" to renderMarkdown(design.text), - "JSON" to renderMarkdown("```json\n${toJson(design.obj).indent(" ")}\n```"), + "Text" to renderMarkdown(design.text, ui=ui), + "JSON" to renderMarkdown("```json\n${toJson(design.obj)/*.indent(" ")*/}\n```", ui=ui), ) ) }, diff --git a/src/main/kotlin/com/github/simiacryptus/aicoder/actions/generic/WebDevAction.kt b/src/main/kotlin/com/github/simiacryptus/aicoder/actions/generic/WebDevAction.kt index 9391d1be..d7a7b267 100644 --- a/src/main/kotlin/com/github/simiacryptus/aicoder/actions/generic/WebDevAction.kt +++ b/src/main/kotlin/com/github/simiacryptus/aicoder/actions/generic/WebDevAction.kt @@ -209,11 +209,11 @@ class WebDevAction : BaseAction() { userMessage = userMessage, initialResponse = { it: String -> architectureDiscussionActor.answer(toInput(it), api = api) }, outputFn = { design: ParsedResponse -> - // renderMarkdown("${design.text}\n\n```json\n${JsonUtil.toJson(design.obj).indent(" ")}\n```") + // renderMarkdown("${design.text}\n\n```json\n${JsonUtil.toJson(design.obj)/*.indent(" ")*/}\n```") AgentPatterns.displayMapInTabs( mapOf( - "Text" to renderMarkdown(design.text), - "JSON" to renderMarkdown("```json\n${JsonUtil.toJson(design.obj).indent(" ")}\n```"), + "Text" to renderMarkdown(design.text, ui=ui), + "JSON" to renderMarkdown("```json\n${JsonUtil.toJson(design.obj)/*.indent(" ")*/}\n```", ui=ui), ) ) }, @@ -236,7 +236,7 @@ class WebDevAction : BaseAction() { .joinToString("\n\n") { it?.let { JsonUtil.toJson(it.openApiDescription) } ?: "" } var messageWithTools = userMessage if (toolSpecs.isNotBlank()) messageWithTools += "\n\nThese services are available:\n$toolSpecs" - task.echo(renderMarkdown("```json\n${JsonUtil.toJson(architectureResponse.obj).indent(" ")}\n```")) + task.echo(renderMarkdown("```json\n${JsonUtil.toJson(architectureResponse.obj)/*.indent(" ")*/}\n```", ui=ui)) architectureResponse.obj.resources.filter { !it.path!!.startsWith("http") }.forEach { (path, description) -> @@ -300,8 +300,8 @@ class WebDevAction : BaseAction() { // Apply codeReviewer fun codeSummary() = codeFiles.entries.joinToString("\n\n") { (path, code) -> "# $path\n```${ - path.split('.').last()?.let { /*escapeHtml4*/(it).indent(" ") } - }\n${code?.let { /*escapeHtml4*/(it).indent(" ") }}\n```" + path.split('.').last()?.let { /*escapeHtml4*/(it)/*.indent(" ")*/ } + }\n${code?.let { /*escapeHtml4*/(it)/*.indent(" ")*/ }}\n```" } @@ -335,7 +335,7 @@ class WebDevAction : BaseAction() { } try { var task = ui.newTask() - task.add(message = renderMarkdown(codeSummary())) + task.add(message = renderMarkdown(codeSummary(), ui=ui)) var design = codeReviewer.answer(listOf(element = codeSummary()), api = api) outputFn(task, design) var textInputHandle: StringBuilder? = null @@ -346,9 +346,9 @@ class WebDevAction : BaseAction() { textInputHandle?.clear() task.complete() task = ui.newTask() - task.echo(renderMarkdown(userResponse)) + task.echo(renderMarkdown(userResponse, ui=ui)) val codeSummary = codeSummary() - task.add(renderMarkdown(codeSummary)) + task.add(renderMarkdown(codeSummary, ui=ui)) design = codeReviewer.respond( messages = codeReviewer.chatMessages( listOf( @@ -388,7 +388,7 @@ class WebDevAction : BaseAction() { if (code.contains("```$language")) code = code.substringAfter("```$language").substringBefore("```") } try { - task.add(renderMarkdown("```${languages.first()}\n${code?.let { /*escapeHtml4*/(it).indent(" ") }}\n```")) + task.add(renderMarkdown("```${languages.first()}\n${code?.let { /*escapeHtml4*/(it)/*.indent(" ")*/ }}\n```", ui=ui)) task.add("$path Updated") codeFiles[path] = code val request1 = (request.toList() + @@ -418,7 +418,7 @@ class WebDevAction : BaseAction() { responseAction(task, "Revising...", formHandle!!, formText) { //val task = ui.newTask() try { - task.echo(renderMarkdown(feedback)) + task.echo(renderMarkdown(feedback, ui=ui)) draftResourceCode( task, (request1.toList() + listOf( code to ApiModel.Role.assistant, diff --git a/src/main/kotlin/com/github/simiacryptus/aicoder/actions/markdown/MarkdownImplementActionGroup.kt b/src/main/kotlin/com/github/simiacryptus/aicoder/actions/markdown/MarkdownImplementActionGroup.kt index 07f4758a..b5038bf5 100644 --- a/src/main/kotlin/com/github/simiacryptus/aicoder/actions/markdown/MarkdownImplementActionGroup.kt +++ b/src/main/kotlin/com/github/simiacryptus/aicoder/actions/markdown/MarkdownImplementActionGroup.kt @@ -75,7 +75,7 @@ class MarkdownImplementActionGroup : ActionGroup() { | | |```$language - |${code?.let { /*escapeHtml4*/(it).indent(" ") }} + |${code?.let { /*escapeHtml4*/(it)/*.indent(" ")*/ }} |``` | |""".trimMargin() diff --git a/src/main/kotlin/com/github/simiacryptus/aicoder/config/ActionSettingsRegistry.kt b/src/main/kotlin/com/github/simiacryptus/aicoder/config/ActionSettingsRegistry.kt index bbbd6fff..021c41e5 100644 --- a/src/main/kotlin/com/github/simiacryptus/aicoder/config/ActionSettingsRegistry.kt +++ b/src/main/kotlin/com/github/simiacryptus/aicoder/config/ActionSettingsRegistry.kt @@ -114,6 +114,11 @@ class ActionSettingsRegistry { var version: Double? = null, // System property var isDynamic: Boolean = false, // Static property var language: String? = null, // Static property + val packageName: String = id.substringBeforeLast('.'), + val className: String = id.substringAfterLast('.'), + val file: File = File(configDir(), "actions/${packageName.replace('.', '/')}/$className.$language").apply { + parentFile.mkdirs() + }, ) { fun buildAction( @@ -151,15 +156,6 @@ class ActionSettingsRegistry { } } - private val packageName: String get() = id.substringBeforeLast('.') - val className: String get() = id.substringAfterLast('.') - - val file: File - get() { - val file = File(configDir(), "actions/${packageName.replace('.', '/')}/$className.$language") - file.parentFile.mkdirs() - return file - } override fun equals(other: Any?): Boolean { if (this === other) return true @@ -175,7 +171,6 @@ class ActionSettingsRegistry { } - override fun hashCode(): Int { var result = id.hashCode() result = 31 * result + enabled.hashCode() diff --git a/src/main/kotlin/com/github/simiacryptus/aicoder/util/CodeChatSocketManager.kt b/src/main/kotlin/com/github/simiacryptus/aicoder/util/CodeChatSocketManager.kt index d6dac474..a39c8be0 100644 --- a/src/main/kotlin/com/github/simiacryptus/aicoder/util/CodeChatSocketManager.kt +++ b/src/main/kotlin/com/github/simiacryptus/aicoder/util/CodeChatSocketManager.kt @@ -35,7 +35,7 @@ open class CodeChatSocketManager( | |```$language |${ - codeSelection.indent(" ") + codeSelection/*.indent(" ")*/ }} |``` | diff --git a/src/main/kotlin/com/github/simiacryptus/aicoder/util/UITools.kt b/src/main/kotlin/com/github/simiacryptus/aicoder/util/UITools.kt index 2e2797f9..7d0aed9c 100644 --- a/src/main/kotlin/com/github/simiacryptus/aicoder/util/UITools.kt +++ b/src/main/kotlin/com/github/simiacryptus/aicoder/util/UITools.kt @@ -845,7 +845,7 @@ object UITools { | |Error Details: |``` - |${toString(e).indent(" ")} + |${toString(e)/*.indent(" ")*/} |``` |""".trimMargin() formBuilder.addLabeledComponent("Error Report", wrapScrollPane(bugReportTextArea)) @@ -917,7 +917,7 @@ object UITools { | |Error Details: |``` - |${toString(e).indent(" ")} + |${toString(e)/*.indent(" ")*/} |``` | |Action History: @@ -931,7 +931,7 @@ object UITools { """ |${it.first} |``` - |${toString(it.second).indent(" ")} + |${toString(it.second)/*.indent(" ")*/} |``` |""".trimMargin() } diff --git a/src/test/kotlin/com/github/simiacryptus/aicoder/ApplicationDevelopmentUITest.kt b/src/test/kotlin/com/github/simiacryptus/aicoder/ApplicationDevelopmentUITest.kt index aa9de9f5..4fce75fb 100644 --- a/src/test/kotlin/com/github/simiacryptus/aicoder/ApplicationDevelopmentUITest.kt +++ b/src/test/kotlin/com/github/simiacryptus/aicoder/ApplicationDevelopmentUITest.kt @@ -121,7 +121,7 @@ class ApplicationDevelopmentUITest { """.trimIndent() ) - out.println("```\n${description.toString()?.let { /*escapeHtml4*/(it).indent(" ") }}\n```") + out.println("```\n${description.toString()?.let { /*escapeHtml4*/(it)/*.indent(" ")*/ }}\n```") newFile("$name.$language") diff --git a/src/test/kotlin/com/github/simiacryptus/aicoder/util/MarkdownProcessor.kt b/src/test/kotlin/com/github/simiacryptus/aicoder/util/MarkdownProcessor.kt index 61f8d3aa..efdaa1ac 100644 --- a/src/test/kotlin/com/github/simiacryptus/aicoder/util/MarkdownProcessor.kt +++ b/src/test/kotlin/com/github/simiacryptus/aicoder/util/MarkdownProcessor.kt @@ -71,7 +71,7 @@ object MarkdownProcessor { for (section in markdownData.sections) { output += "\n## ${section.title}\n\n```${section.codeType}\n${ section.code?.let { - /*escapeHtml4*/(it).indent(" ") + /*escapeHtml4*/(it)/*.indent(" ")*/ } }\n```\n" }